Jump to content

younis

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

younis's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm not proficient enough with PHP to know how to do that. Is there any chance someone could help?
  2. When someone fills in & submits the form it just reloads the page with no email sent.
  3. The following code used to work in PHP 4, but it no longer works under PHP 5. Can someone take a look and let me know what needs fixing please? I'm not new to PHP, but I'm not an expert. <? // Set page variables. $title = "Feedback Form"; $back = ""; $bg = '000066'; $text = 'ffffff'; $link = 'ffff00'; $vlink = 'ff0000'; $trans = 'spinoutin'; $btntag = 'text=000070 insetselection'; $txtbxtag = 'bgcolor=ffffff text=000070 cursor=ff autoactivate nohighlight'; $ip = $_SERVER['REMOTE_ADDR']; // Remove < and > from the email message. $msg = str_replace("<","",$msg); $msg = str_replace(">","",$msg); // Set email variables. $your_email = 'email@mydomain.com'; $your_name = 'Joe Blogs'; $your_link = 'http://www.mydomain.com/'; $confirm_sub = 'Message Sent'; $confirm_msg = "Hi $feedbackname, Thank you for your email message sent from the $sub. I will respond to it as quickly as I can. Thanks again, $your_name $your_link"; $contact_msg = "$feedbackname ($feedbackemail) wrote: $msg $ip"; // Begin the sendmail routine. if ($send) { if (!$feedbackname || !$feedbackemail || substr_count($feedbackemail, '@') < 1 || substr_count($feedbackemail, '.') < 1 || !$sub || !$msg || substr_count($spam, 'clark') < 1) { print <<<EOF <html> <title>Error!</title> <body background="$back" bgcolor="$bg" text=$text link=$link vlink=$vlink transition=$trans fontsize=medium> <center> <br><br> <font s=7 c=f0><b> Error!</b></font> <p> Please go back and correct the errors listed below: <p> <table> <tr><td> <ul> EOF; if (!$feedbackname) { print "<li>Your name is missing!<br>"; } if (!$feedbackemail || substr_count($feedbackemail, '@') < 1 || substr_count($feedbackemail, '.') < 1) { print "<li>Your email is missing or invalid!<br>"; } if (!$sub) { print "<li>The email subject is missing!<br>"; } if (!$msg) { print "<li>The email message is missing!"; } if (substr_count($spam, 'clark') < 1) { print "You need to correctly type in the Anti-Spam word. Hit Back and try again."; } print <<<EOF </ul> </table> <p> <A href="feedback.php">Back</A> <br><br><br><br> </center> </body> </html> EOF; } else { // Email that gets sent to you. mail($your_email, $sub, $contact_msg, "From: $feedbackname < $feedbackemail >"); // Email that gets sent to them. mail($feedbackemail, $confirm_sub, $confirm_msg, "From: $your_email"); // Print the thank you page. print <<<EOF <html> <head><title>Message Sent</title> </head> <body background="$back" bgcolor="$bg" text=$text link=$link vlink=$vlink transition=$trans> <H2>Feedback</H2> Thanks $feedbackname for sending your message to me!<P> You will receive a confirmation email momentarily.<P> </body> </html> EOF; } } else { // Print the contact form page. print <<<EOF <H3>Feedback Form</H3> To send an email to me simply fill out the form below.<P> <form method=post> Name: <input name=feedbackname $txtbxtag size=40><P> Email: <input name=feedbackemail $txtbxtag size=40><P> <INPUT type="hidden" name="sub" value="Feedback Form"> Message:<br> <textarea name=msg rows=10 cols=50 maxlength=500 $txtbxtag></textarea><P> <IMG SRC="images/sh-layout/turing.jpg" WIDTH="100" HEIGHT="30" BORDER="0" ALT="turing"><BR> Anti-Spam Measure - In lowercase letters, retype the word in the image above:<BR> <input name=spam $txtbxtag size=40><P> <INPUT TYPE=submit NAME=send $BTNTAG VALUE="Send"><BR> </form> EOF; } ?>
  4. It's okay. I've resolved the problem. I re-typed the code and it worked.
  5. Line 3 in the version with the Array. Parse error: syntax error, unexpected T_STRING in /.../htdocs/comics/comics.php on line 3 http://www.supermanhomepage.com/comics/comics.php?topic=comics-coming
  6. Thanks for the suggestion, but your code gives me the following error: Parse error: syntax error, unexpected T_STRING Am I missing something?
  7. Hi, This is fairly urgent, so I appreciate any help anybody can give me ASAP. I recently upgraded from PHP 4 to 5 and now certain "include" code is not working on my site. Here's an example: // if topic selected, display the relevant content. if ($topic == 'page1') { include ("$topic.php"); } elseif ($topic == 'page2') { include ("$topic.php"); } // else wrong or no link selected. else { print "Go to the <A HREF = 'main.php'>Main page</A>"; } Let's say the above code was in a PHP file called "frontpage.php". It used to be that if a person went to "mydomain.com/frontpage.php?topic=page1" then the page called for in the above code would include the content of "page1.php" in "frontpage.php". It's no longer working. Any ideas why or how to fix it? Any better way of doing this? Thanks, Steve
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.