GetDotted Domains

Viewing Thread:
"Three questions (two PHP, one Flash)"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Sat 09/10/04 at 12:51
Regular
"Pouch Ape"
Posts: 14,499
1. PHP Mail - how do you change the 'from' address to something that's not the server name?

2. Cookies - is there any reason I can set and retrieve these on one Linux PHP server, but not another?

3. HTML content - can I put HTML, or PHP, pages into Flash by assigning content to a scrollframe? Like how iframe works in IE? I should know this one, but can't be bothered to remember.


Oh, and thanks in advance.
Sun 10/10/04 at 13:38
Regular
"Pouch Ape"
Posts: 14,499
Ahh, it works now - I was using the IP address I was given, instead of the domain name like I should have been. D'oh!

And yes, I tested it every possible way - it really wasn't setting.
Sun 10/10/04 at 13:11
Regular
"It goes so quickly"
Posts: 4,083
Are you sure it won't set? Have you tried setting your browser to notify you and ask about every cookie which tried to set itself?

Try setting a cookie without any timestamp, domain, site or secure server, but just with a name and value - or check that $content doesn't contain any characters which could cause PHP to drop out of the setcookie function.

Have you got these test online?
Sun 10/10/04 at 12:36
Regular
"Pouch Ape"
Posts: 14,499
I've actually used the older method (HTTP_), will try the newer one and let you know.

The problem is setting the cookie though - it won't. I've used this script on two other sites and it's worked fine (before the headers, of course):

setcookie("cookiename", $content, time()+3600 * 24, "directory", "sitename.com", 0);

It won't set - not in temp files or anything.
Sun 10/10/04 at 12:33
Regular
"It goes so quickly"
Posts: 4,083
No worries. Should you want to send HTML emails, you'd use that same 4th parameter again to add the relevent header FROM: [email protected]\r\nMIME-Version: 1.0\r\nContent-type: text/html; charset=iso-8859-1.

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

2. Cookies - is there any reason I can set and retrieve these on one Linux PHP server, but not another?

As Nimco said, it might be the PHP version numbers. Older versions of PHP use the $HTTP_COOKIE_VARS['cookiename'] superglobal, whereas newer versions (PHP 4.1.0 upwards) use the $_COOKIE['cookiename'] superglobal (superglobals are variables available anywhere in a PHP page). Newer versions also make use of the $_REQUEST['cookiename'] superglobal.

The problem might also be that register_globals is turn on on one server, but not the other. If this is the case, $cookiename would be available only on the server with register_globals turned on.

What code have you used to work with the cookie?
Sun 10/10/04 at 11:48
Regular
"Pouch Ape"
Posts: 14,499
Muuuuuuh, I'm such a Joey - I actually took that 4th parameter out of the mail tag because I thought it was useless! OK, cheers for giving me a link to what I should have looked at anyway!
Sat 09/10/04 at 13:30
Regular
"NULL"
Posts: 1,384
2. No idea - upload a phpinfo() file to both and see if there are any settings related to cookies that are turned off. Make sure both are running similar versions and that your script uses global variables (e.g. $_COOKIE['mycookie'] not $mycookie). An older version of PHP may even need $HTTP_COOKIE['mycookie'].

3. Should be able to, yes. Can you call the PHP page directly, since if you call it into Flash from the server, the server will parse the PHP.
Sat 09/10/04 at 13:18
Regular
"It goes so quickly"
Posts: 4,083
1.
PHP Mail - how do you change the 'from' address to something that's not the server name?


Simply add the extra headers ([URL]http://uk.php.net/manual/en/function.mail.php[/URL]):

mail("[email protected]","Subject - Contact Form","Message content - hello world","FROM: [email protected]");
Sat 09/10/04 at 12:51
Regular
"Pouch Ape"
Posts: 14,499
1. PHP Mail - how do you change the 'from' address to something that's not the server name?

2. Cookies - is there any reason I can set and retrieve these on one Linux PHP server, but not another?

3. HTML content - can I put HTML, or PHP, pages into Flash by assigning content to a scrollframe? Like how iframe works in IE? I should know this one, but can't be bothered to remember.


Oh, and thanks in advance.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

First Class!
I feel that your service on this occasion was absolutely first class - a model of excellence. After this, I hope to stay with Freeola for a long time!
Brilliant service.
Love it, love it, love it!
Christopher

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.