Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by mattisl

  1. If you don't like Javascript you could use this PHP solution: 1. Create a folder called rand_images and put all the images in it. 2. Name the images 0.gif, 1.gif, 2.gif, 3.gif, 4.gif etc. 3. Create a file called rand_images.php and put this code into it: ><? // This script returns an image header("Content-type: image/gif"); $image_count = 5; // Set this variable to the total amount of // images in the rand_images folder // Load a random image $image = fopen("rand_images/".rand(0,$image_count-1).".gif","r"); // Return the image fpassthru($image); ?> 4. Now when you want to display a random image, just use this html code: ><img src="rand_images.php"> ---------- This should work
  2. Try putting this code at the start of the classes.php file: >// Start session session_start(); // Get selected language from url switch($_GET["sessLang"]) { default: // No language has been selected case "english": // English has been selected $_SESSION["sessLang"] = "english"; break; case "french": // French has been selected $_SESSION["sessLang"] = "french"; break; } Now the language value is stored in the element "sessLang" in the $_SESSION array. You will also need to put session_start(); at the beginning on every page where you want to get access to the $_SESSION array.
  3. Changing the return value to 0 didn't change anything I checked the delivery failure e-mail again and found this error: Warning: fread(): supplied argument is not a valid stream resource in /home/myusername/public_html/myfolder/parser.php on line 5. Line 5 is: $message = fread(STDIN, 1024);
  4. The script runs now when I send an e-mail to me@****. However I get a "Mail delivery failure" e-mail back to the address I sent the first e-mail from. I understand that I need to return some kind of value that indicates that the script was successful, which value should be returned? Also I wasn't able to read the e-mail from STDIN. This is my code so far: >#!/usr/bin/php <? if(!defined("STDIN")) define("STDIN", "fopen('php://stdin','r')"); $message = fread(STDIN, 1024); mail("mattis@gamalog-media.com","E-mail parsing test!","The message:\n".$message,""); return true; ?>
  5. Still can't get it working This is how I set it up: Destination: |/home/myusername/public_html/myfolder/parser.php Then I set the parser.php permissions to 744. My parser.php file looks exactly like this:; >#!/usr/bin/php <? mail("me@****","E-mail parsing test!","Seems to work...",""); ?> When I run the filter test in Cpanel it shows this: ------------ If all works right I should receive an e-mail at me@**** sent from the php-script, this mail however doesn't get sent =/. Going directly to http://www.example.com/myfolder/parser.php works. Thanks for your help so far, the support is great as always Rock Sign
  6. Looks exactly like the thing I need However I couldn't quite figure out how the destination works. Lets say I have my php-parser called "parser.php" in a subfolder called "myfolder" (the full url would be http://www.example.com/myfolder/parser.php). What should the destination text look like? I've tried: "|/home/myusername/myfolder/parser.php" "|/home/myusername/public_html/myfolder/parser.php" "|/myfolder/parser.php" "|/public_html/myfolder/parser.php" But without success.
  7. Is it possible to trigger a PHP-script when an e-mail has been received on a specific address? E.g when a mail has been sent to automatic@**** I want the content to be parsed by one of my php script automatically. Can this be done? / Mattis
  8. Hi, I also needed bbCode support on one of my sites a while ago. I found the part of the phpbb code that took care of the text parsing but I was to lazy to figure out how those regular expressions work . I wrote my own function that does some search and replace actions instead, it might be a little slower but it seems to work . The functions supports: [ i ] italic [ /i ] [ b ] bold [ /b] [ u ] underline [ /u ] [ url ] links [ /u ] [ url=http://something ] hyperlinks [ /url ] [ img ] image.gif [ /img ] I attached it to this post. Hope it helps textparsing.txt
  9. Hi, I currently have a Gold Plan account at TCH. One of my websites may need more bandwidth so I thought I'll check out the options for a dedicated server However I am a little confused about the difference of the three services you offer and have some questions: 1. Does Semi-dedicated meen that there are 2 users on the server? 2. What is the difference between Managed and Unamanaged? Which things will I have to manage myself? 3. Will you still fix hardware-, software problems with my server if it is Unmanaged? Thank you
  10. Hi, I am coding an internet browser game which is getting pretty big (code-wise). I just tried running the battle script for the game and added a timer for the execution time. The battle PHP script takes about 0.5 to 1.0 seconds to execute while the other pages take 0.1 or less. I am on a shared server (server 64) and wonder if scripts that take more than 1 second to execute will slow down the other websites on that server. Also, does the server run several PHP scripts at once, or does it run one script at a time?
  11. Hi, I'm not sure if this is the right forum to post in, feel free to remove/move the post if it isn't I am searching for a new software that can manage remote mySQL databases. I have been using a program called MySQL Front a few months now, but it has so many bugs I can't use it for larger databases anymore. Any tips for another program that works well with large databases? / Mattis
  12. Thank you for your suggestions These sure look interesting, I will have a look at them and see if they're what I'm searching for. / Mattis
  13. Hi, I would like to set up a little shop for my site where I can sell some of our companies software. The problem is that everything needs to be automatic, which means: 1. User clicks 'Buy' -button 2. User enters credit card information etc. 3. User sends money 4. User receives a link where he/she can download the software I have considered using Paypal for this, but I could not find a way to make some kind of custom e-mail sent to the user with a link when the payment is done. Are there some other (free) alternatives instead of Paypal to do this? Thanks in advance / Mattis
  14. Yup, seems like my ISP is blocking port 25 or something. Changing it to 26 worked. You guys are great -> Rock Sign <-
  15. Hi, I recently changed my domain and am now trying to configure a few pop3 mail accounts for it. But when I try to connect to them using Outlook XP I get an error (see attached image). At first I thought it's because my mail.domain.com hadn't propagated yet but then I tried using the ip-number, same problem. I am pretty sure I have all the correct settings: E-mail address: myuser@**** Incoming mail server: xx.xx.xxx.xxx Outgoing mail server: xx.xx.xxx.xxx User name: myuser@**** Password: ***** My Outgoing server (SMTP) requires authentication - Checked Incoming server: 110 This server requires a secure connection (SSL) - UNchecked Outgoing server: 25 This server requires a secure connection (SSL) - UNchecked Is there something else I have to do? Thanks in advance / Mattis
  16. They are ignoring my e-mail, seems like I can't do anything Mad!!! Guess I have to search for a new domain registrar. Has anybody had any experience with NameCheap and GoDaddy? Thanks for the nice welcome here guys
  17. Hmm, my last host created the domain for me and I did not get any login information for my registrar. Going to http://www.whois.sc/gamalog.com gave me this information: ICANN Registrar: ENOM, INC. I don't know what to do
  18. I have now registered an account. How do I know who my registrar is? I couldn't find this info anywhere.
  19. Hi everyone The last year I have had some very bad experiences with hosting companies and am now searching for a new one. First of all I must say that this place looks really promising, not many hosting companies dare to put up a user-forum like this. Anyway, I have a few questions before I decide to register: How fast is the server-side scripting working (e.g PHP)? Do you have a limit on how many users you have on the same server? Is there some way to change the hosting plans to fit my needs? I don't need 1000 MB of disk-space, but I could need more bandwidth than 18GB/month. I already have a domain name, can I "move" this domain to this new host without having to contact my old host? They really screw up and I don't want to go through all mess again to make them transfer my domain. I think this is all (for now ) Any response will be greatly appreciated Thanks in advance - Mattis
  • Create New...