Forum Moderators: coopster

Message Too Old, No Replies

contact form help

         

jake66

4:33 am on Jan 11, 2006 (gmt 0)

10+ Year Member



i'm trying to work a tell a friend script, while using mod_rewrite for cleaner url's.

i can't figure out how to incorperate the $_SERVER['REQUEST_URI'] command with it.

here's what i have so far.

(this is only snippets.. i won't bother posting the entire script unless someone requests it)

// Retrieve all the info
$pageurl = $_POST["pageurl"];
$in_name = $_POST["name"];
$in_email = $_POST["email"];
$in_count = $_POST["count"];
$in_message = $_POST["message"];

// Form the mail here
$mail_from = "$in_email";
$mail_replyto = "$in_email";
$mail_bcc = $bcc;

$mail_headers = "From: $in_name <$mail_from>\r\n";
$mail_headers .= "Reply-to: $mail_replyto\r\n";
$mail_headers .= "Bcc: $mail_bcc";

$mail_subject = "$subject";

$mail_message = "Your friend $in_name thought you would be interested in checking out this site:";
$mail_message .= "Click below to be taken to the link:\n";
$mail_message .= "URL:\n";
$mail_message .= "$pageurl \n\n";
$mail_message .= "$in_message";

.... for $pageurl i want to put [mysite.com$_SERVER['REQUEST_URI']...] but i keep encountering errors, no matter how many different ways i try it

FalseDawn

5:10 am on Jan 11, 2006 (gmt 0)

10+ Year Member



You can use:
$pageurl='http://www.mysite.com' . $SERVER['REQUEST_URI'];

Not quite sure what the problem is...

jake66

11:21 pm on Jan 14, 2006 (gmt 0)

10+ Year Member



thanks!
that worked (no errors), but the message url only shows [mysite.com...] , not the filename the person is currently looking at.
any suggestions?

totage

2:17 am on Jan 15, 2006 (gmt 0)

10+ Year Member



If your just looking for a TAF script, you can try hotscripts.com. I'm sure you'll find a TAF script that suits your needs. If your looking for help on how to write a TAF script yourself, I'm sorry I don't know much more about PHP than how to install PHP scripts.

coopster

3:14 pm on Jan 16, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Looks like FalseDawn missed the underscore in the $_SERVER superglobal is all:
$pageurl='http://www.mysite.com' . $_SERVER['REQUEST_URI'];

You should have received a syntax error (that is, if you have your error_reporting() [php.net] turned up during development and testing). See the PHP Forum Library for more Troubleshooting tips [webmasterworld.com].

jake66

2:11 am on Jan 17, 2006 (gmt 0)

10+ Year Member



totage, that's where i got this script from. i'm just trying to modify it to fit my needs

coopster, thanks! that did the trick.
now i am trying to post the item name from the database, which is: $product_info['products_name'];

i can't seem to get this into a variable like $in_name = $_POST["name"]; so i can post it anywhere i need it in the form.