Jump to content

BenMo

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

BenMo's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Good to know. Thanks so much! That was confusing the hell out of me.
  2. Hmm, I don't know what register globals are, so perhaps this is the problem. Any guesses on what the default problem would be if I haven't changed anything?
  3. I've run into a very weird error. I found a way to work around the problem, but I don't understand why it was a problem in the first place. I'm creating a login system using SESSION and MySql calls, and there is an overlap in the variables, meaning that it seems php thinks that a $_SESSION var and a $php var are the same variable. session_start(); $myusername=$_SESSION['username']; $mypassword=$_SESSION['password']; $host="localhost"; // Host name $username="BenMo"; // Mysql username $password="something"; // Mysql password $db_name="homeBase"; // Database name $tbl_name="Users"; // Table name // Connect to server and select databse. $con = mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); What is strange is that the var $_SESSION['username'] gets set to the $username var after this code runs. So when the page loads, $_SESSION['username'] is storing the value "BenMo", instead of what used to be in the session var. If I change $username to something else, like $username2, then there isn't a problem. There isn't code here or anywhere else that assigns a value to the $_SESSION['username'] var. Does anyone know what's going on?
  4. All you have to do is escape out of the quotations in your echo statement... while($row = mysql_fetch_array($result)) { echo "<script type='text/javascript'>\n"; echo "var arr = new Array();"; echo "arr[0]=" . $row[0]; // Right here, you leave javascript and go into PHP to get the value, which is printed into JS echo "document.write(arr[0]);\n"; //echo "document.write('New value of i is' + i);\n"; echo "</script>"; echo $row[0]." ".$row[1]."<br>"; } Just do that for the other vars too.
  5. I'm trying to create an array of an object that I've defined. For example, let's say I've created the object "person": function person(firstname,lastname,age,eyecolor) { this.firstname=firstname this.lastname=lastname this.age=age } now I want to create an array of "person" objects so that I can do things like refer to thePerson[1].firstname, but I can't figure out how to combine the array and custom object syntax. For example, to make an array I go: var theArray = new Array() And this leaves no room for me to declare the array as an array of my objects, since the "new" keyword is already used up on the Array...I've tried things like: var thePeople = new person; thePeople[0].firstname = "bob" thePeople[1].firstname = "cindy" But this doesn't work. Any help? Thanks so much! Let me know if I'm not explaining the question well. It's probably something really obvious but I can't figure it out.
  6. Hello, I'm a PHP beginner, and I'm trying to build a simple site that has basic login functions, such as allowing them to sign up by entering their email and password, and then logging in and have the site display their account's data on various pages. I've created pages that allow them to create an account and login and log out of the account, but I'm not sure how to go about the structure of creating a collection of pages where information about the account is accessible at all times. For example, on a given page I'd like to be able to pull out whether or not they are logged in, and if they are, display their name on the page. The only strategies I've used so far are $_POST and some forms; is this all I need? Where can I find some good tutorials on how to pass data around in between pages in this manner? Or any general framework help would be great. Thanks so much!
  7. That's great! I had such difficulty finding that in a tutorial anywhere. Thanks!
  8. Hmm...ok, well, I tried to throw some PHP code in the middle of some javascript, but with no avail... <html> <head> <script type="text/javascript"> function displaymessage() { <?php echo "Hey"; ?> } </script> </head> <body> <form> <input type="button" value="Click me!" onclick="displaymessage()" > </form> </body> </html> ...is this the right direction?
  9. Hello! I'm just starting to learn PHP, and I'm tinkering around with making some pages myself. I would like to make a page with two form buttons that can do two different things, say, clicking one creates a new entry in a database and clicking another lists all the data currently in the database (These actions could be anything for example's sake). I've gone through the w3schools PHP tutorial and have poked around on other PHP sites, but I can't seem to find how to do this. In javascript I can simply write a function() and then have the onclick of the button call the function, but no luck with PHP. How do I do this, and where can I go to find some tutorials that will give me a better understanding of having different buttons do different things? Thanks so much!
  10. I put both the mailer.php and the info.html form in the same directory. Perhaps there's a hard-coded string that points to some directory...? Also, I don't really expect anyone to look through that code; I just posted it just in case. I'm 99.9% sure that the problem is very simple, like putting something in the right directory.
  11. I recently outsourced to have a programmer write a php form for me to use that would collect text and images from a website and email them to my inbox. The files worked on his server, but when I uploaded them to my server I receive errors and the images do not successfully attach to the email. Do I need to change some settings on my servers or something? I really have no idea and any help is appreciated. The errors I received looked like this... Warning: move_uploaded_file(imgs/20070203205052_attachment1.jpg): failed to open stream: No such file or directory in /home/benjammin9/www/brb/mailer.php on line 67 Warning: move_uploaded_file(): Unable to move '/tmp/phpAcrPgk' to 'imgs/20070203205052_attachment1.jpg' in /home/benjammin9/www/brb/mailer.php on line 67 Warning: fopen(imgs/20070203205052_attachment1.jpg): failed to open stream: No such file or directory in /home/benjammin9/www/brb/mailer.php on line 73 Warning: filesize(): Stat failed for imgs/20070203205052_attachment1.jpg (errno=2 - No such file or directory) in /home/benjammin9/www/brb/mailer.php on line 74 Warning: fread(): supplied argument is not a valid stream resource in /home/benjammin9/www/brb/mailer.php on line 74 Warning: fclose(): supplied argument is not a valid stream resource in /home/benjammin9/www/brb/mailer.php on line 75 Warning: move_uploaded_file(imgs/20070203205052_attachment2.jpg): failed to open stream: No such file or directory in /home/benjammin9/www/brb/mailer.php on line 67 Warning: move_uploaded_file(): Unable to move '/tmp/php7KDvnP' to 'imgs/20070203205052_attachment2.jpg' in /home/benjammin9/www/brb/mailer.php on line 67 Warning: fopen(imgs/20070203205052_attachment2.jpg): failed to open stream: No such file or directory in /home/benjammin9/www/brb/mailer.php on line 73 Warning: filesize(): Stat failed for imgs/20070203205052_attachment2.jpg (errno=2 - No such file or directory) in /home/benjammin9/www/brb/mailer.php on line 74 Warning: fread(): supplied argument is not a valid stream resource in /home/benjammin9/www/brb/mailer.php on line 74 Warning: fclose(): supplied argument is not a valid stream resource in /home/benjammin9/www/brb/mailer.php on line 75 Warning: move_uploaded_file(imgs/20070203205052_attachment3.jpg): failed to open stream: No such file or directory in /home/benjammin9/www/brb/mailer.php on line 67 Warning: move_uploaded_file(): Unable to move '/tmp/phpwdtnuk' to 'imgs/20070203205052_attachment3.jpg' in /home/benjammin9/www/brb/mailer.php on line 67 Warning: fopen(imgs/20070203205052_attachment3.jpg): failed to open stream: No such file or directory in /home/benjammin9/www/brb/mailer.php on line 73 Warning: filesize(): Stat failed for imgs/20070203205052_attachment3.jpg (errno=2 - No such file or directory) in /home/benjammin9/www/brb/mailer.php on line 74 Warning: fread(): supplied argument is not a valid stream resource in /home/benjammin9/www/brb/mailer.php on line 74 Warning: fclose(): supplied argument is not a valid stream resource in /home/benjammin9/www/brb/mailer.php on line 75 Warning: move_uploaded_file(imgs/20070203205052_attachment4.jpg): failed to open stream: No such file or directory in /home/benjammin9/www/brb/mailer.php on line 67 Warning: move_uploaded_file(): Unable to move '/tmp/php3plpBP' to 'imgs/20070203205052_attachment4.jpg' in /home/benjammin9/www/brb/mailer.php on line 67 Warning: fopen(imgs/20070203205052_attachment4.jpg): failed to open stream: No such file or directory in /home/benjammin9/www/brb/mailer.php on line 73 Warning: filesize(): Stat failed for imgs/20070203205052_attachment4.jpg (errno=2 - No such file or directory) in /home/benjammin9/www/brb/mailer.php on line 74 Warning: fread(): supplied argument is not a valid stream resource in /home/benjammin9/www/brb/mailer.php on line 74 Warning: fclose(): supplied argument is not a valid stream resource in /home/benjammin9/www/brb/mailer.php on line 75 Warning: move_uploaded_file(imgs/20070203205052_attachment5.jpg): failed to open stream: No such file or directory in /home/benjammin9/www/brb/mailer.php on line 67 Warning: move_uploaded_file(): Unable to move '/tmp/phpivdDIk' to 'imgs/20070203205052_attachment5.jpg' in /home/benjammin9/www/brb/mailer.php on line 67 Warning: fopen(imgs/20070203205052_attachment5.jpg): failed to open stream: No such file or directory in /home/benjammin9/www/brb/mailer.php on line 73 Warning: filesize(): Stat failed for imgs/20070203205052_attachment5.jpg (errno=2 - No such file or directory) in /home/benjammin9/www/brb/mailer.php on line 74 Warning: fread(): supplied argument is not a valid stream resource in /home/benjammin9/www/brb/mailer.php on line 74 Warning: fclose(): supplied argument is not a valid stream resource in /home/benjammin9/www/brb/mailer.php on line 75 If you need to look at the code, then the HTML form code runs thusly... <!-- Begin form --> </p> <form action="mailer.php" method="post" enctype="multipart/form-data"> <table summary="feedback form" border="0" cellpadding="8" cellspacing="8"> <tbody><tr> <td>Child's First Name: <input type="hidden" name="page" value="info.html" /> <input type="hidden" name="recipient" value="BigRed" /> <input type="hidden" name="subject" value="Child Information Form" /> <input type="hidden" name="required" value="name, gender, mom, dad, hobby, neighborhood, message1, message2, message3, finalmessage, email, email2, referral, attachment1, attachment3, attachment5" /> <input type="hidden" name="print_blank_fields" value="true" /> <input name="alias" type="hidden" id="alias" value="name=Child First Name, mom=Mother's Nickname, dad=Father's Nickname, hobby=Child's Hobby, neighborhood=Neignborhood, message1=1st Message to Child from someone special, message2=2nd Message to Child from someone special, message3=3rd message to child from someone special, finalmessage=Final Message, email=Email Address, email2=Confirm Email Address, attachment1=Image of Child's Face, attachment2=2nd Image of Child's Face, attachment3=Image of Child's Family, attachment4=2nd image of Child's Family, attachment5=Image of Child's House" /> </td> <td><input name="name" type="text" size="25"></td></tr> <tr><td>Gender (M or F):</td><td><input name="gender" type="text" size="2"></td></tr> <tr><td>Nickname that child calls mother (Examples: "Mom", "Mommy", "Ma"):</td><td><input name="mom" type="text" size="15"></td></tr> <tr><td>Nickname that child calls father (Examples: "Dad", "Daddy"):</td><td><input name="dad" type="text" size="15"></td></tr> <tr><td>Child's Hobby (Examples: Swimming, Dance, Drawing):</td><td><input name="hobby" type="text" size="25"></td></tr> <tr><td>Neighborhood, town, or location that the child most associates with home:</td><td><input name="neighborhood" type="text" size="25"></td></tr> <tr><td>Message to the Child from someone special(such as friends, teachers, etc):</td><td> <textarea rows="5" cols="35" name="message1"> </textarea></td></tr> <tr><td>A second message to the Child from someone special:</td><td> <textarea rows="5" cols="35" name="message2"> </textarea></td></tr> <tr><td>A third message to the Child from someone special:</td><td> <textarea rows="5" cols="35" name="message3"> </textarea></td></tr> <tr><td>A final message from you to the Child(Will be displayed at the end of the game):</td><td> <textarea rows="6" cols="40" name="finalmessage"></textarea></td></tr> </tbody></table> <h1>Contact Information and Referral</h1> <p> </p><table summary="feedback form" border="0" cellpadding="8" cellspacing="8"> <tbody><tr><td>Email address (Software download will be sent here):</td><td><input name="email" size="25" type="text"></td></tr> <tr><td>Confirm email address:</td><td><input name="email2" size="25" type="text"></td></tr> <tr><td>Did anyone refer you to our product? (First and last name):</td><td><input name="referral" size="25" type="text"></td></tr> </tbody></table> <h1>Source Images</h1> <p> </p><table summary="feedback form" border="0" cellpadding="8" cellspacing="5"> <tbody><tr><td>Image of Child's Face:</td> <td><input name="attachment1" type="file" size="45" id="attachment1" /> <br></td></tr> <tr><td>Second Image of Child's Face (Optional, but recommended):</td><td><input name="attachment2" size="45" type="file"><br></td></tr> <tr><td>Image of Child's Family:</td><td><input name="attachment3" size="45" type="file"><br></td></tr> <tr><td>Second Image of Child's Family (Optional, but recommended):</td><td><input name="attachment4" size="45" type="file"> <br></td></tr> <tr><td>Image of Child's House:</td><td><input name="attachment5" size="45" type="file"><br></td></tr> <tr> </tr> <tr> <td colspan="2" align="center"> <input value="Send" type="submit"><br><small> </small></td> </tr> </tbody></table> </form> <!-- End Form --> and the form ran like this... <? // setup the form content for use $form = array(); $fieldname_lookup = array(); $in_array_func=""; $invis_array=array(); initialize(); // setup email (sender, subject, and body content $email_from = 'Web Agent <support@bigredbutton.com>'; $email_subject = $_POST['subject']; // to avoid spamming - hide address on form //$recipient_array = array('BigRed'=>'BigRedButtonLLC@gmail.com'); //$email_to=$recipient_array[$_POST['recipient']]; $email_to="BigRedButtonLLC@gmail.com"; // to add more emails, simply comma and space // setup the email body content - from the form reset($form); $mailbody = "<h3>The following information has been submitted:</h3>"; while (list($key,$val) = each($form)) { if ((!$in_array_func($key,$invis_array)) && ((isset($form['print_blank_fields'])) || ($val))) { if (isset($fieldname_lookup[$key])) { $key = $fieldname_lookup[$key]; } $key=strtoupper($key); $mailbody .= "<div><b>".htmlspecialchars($key); $mailbody .= '</b>: ' . nl2br(htmlspecialchars(stripslashes($val))) . "</div>"; } } // email plumbing work $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; $headers = "From: ".$email_from. "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; $email_message=$mailbody; $email_message .= "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type:text/html; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $email_message . "\n\n"; // let's loop through the attachments // special trick // get count of attachments for ($r=1; $r<=5; $r++){ $att="attachment".$r; if(strlen($_FILES[$att]['name'])>0){ if(strlen($att_cnt)!=0){ $att_cnt.=",";} $att_cnt.=$att; } } $att_active = explode(',', $att_cnt); for ($r=0; $r<count($att_active); $r++){ $att=$att_active[$r]; if(strlen($_FILES[$att]['name'])>0){ $ext=substr($_FILES[$att]['name'],strlen($_FILES[$att]['name'])-4,4); $filename=date("YmdHis")."_".$att.$ext; $uploadfile = "imgs/".$filename; move_uploaded_file($_FILES[$att]['tmp_name'], $uploadfile); $fileatt=$uploadfile; $fileatt_type = "application/octet-stream"; $fileatt_name =$_FILES[$att]['name']; $file = fopen($fileatt,'rb'); $data = fread($file,filesize($fileatt)); fclose($file); $data = chunk_split(base64_encode($data)); if($r==0){ $email_message .= "--{$mime_boundary}\n"; } $email_message .= "" . "Content-Type: {$fileatt_type};\n" . " name=\"{$fileatt_name}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n"; if($r==count($att_active)-1){ $email_message.="--{$mime_boundary}--\n"; } else { $email_message.="--{$mime_boundary}\n"; } unset($data); unset($file); unset($fileatt); unset($fileatt_type); unset($fileatt_name); } } $ok = @mail($email_to, $email_subject, $email_message, $headers); if($ok) { ?> <div align="center"> <table cellSpacing="8" width="98%" border="0" id="table1" bordercolorlight="#000000"> <tr> <td class="small" colSpan="2"><div align="center"> <p><font face="Verdana" size="2"> </font><b><font face="Verdana" size="4" color="#FF0000"><u> </u></font></b></p> <p><b><font face="Verdana" size="4" color="#FF0000"><u>Thank you!</u></font></b> </p> </div> <p align="center"> <b><font face="Verdana" size="2">Your information has been <font color="#FF0000">submitted</font>. <br> You will hear back from us <u>via e-mail </u>within 24 business hours.<br> <br> <br> <br> </font></b></p> <p></b></td> </tr> <td align="center"> <font face="Arial" size="1"> Copyright ゥ 1999-2005, BigRedButton</font> </table> </div> <? } else { die("Sorry but the email could not be sent. Please go back and try again!"); } ?> <? ###############################################33 # special supporting function segment function decode_vars() { if (isset($_REQUEST)) $request = '_' . getenv('REQUEST_METHOD'); else $request = 'HTTP_' . getenv('REQUEST_METHOD') . '_VARS'; global $$request; if (count($$request) > 0) { while (list($key, $val) = each($$request)) { if (is_array($val)) $val = implode(', ',$val); $output[$key] = stripslashes($val); } return $output; } else return array(); } function check_required(){ global $form; $error=""; if (isset($form['required'])) { $required = split(',', $form['required']); while (list(,$val) = each($required)) { $val = trim($val); if ((!isset($form[$val])) || (isset($form[$val]) && (strlen($form[$val]) < 1))) { // we got problem here $field = $val; if(substr($field,0,10)=="attachment"){ if (!isset($_FILES[$field]['name']) || (isset($_FILES[$field]['name']) && (strlen($_FILES[$field]['name']) < 1)) ){ $error.= "<li>".$field."</li>"; $hit++; } } else { $error.= "<li>".$field."</li>"; $hit++; } } } if ($hit>0){ $error="<h1>Errors encountered</h1><H4>The following fields must be filled in:</h4><ul>".$error."</ul>"; print $error; return 0; } else { return 1; } } return 1; } function alias_fields() { global $form, $fieldname_lookup; while (list($key,) = each($form)) { $fieldname_lookup[$key] = $key; } reset($form); if (isset($form['alias'])) { $aliases = explode(',', $form['alias']); while (list(,$val) = each($aliases)) { $temp = explode('=', $val); $fieldname_lookup[trim($temp[0])] = trim($temp[1]); } } return true; } function fake_in_array($needle, $haystack) { $found = false; while (list($key,$val) = each ($haystack)) { if ($needle == $val) $found = true; } return $found; } function initialize(){ global $form, $in_array_func, $invis_array; $form=decode_vars(); alias_fields(); if (phpversion() >= '4.0.0') $in_array_func = 'in_array'; else $in_array_func = 'fake_in_array'; // lets validate first if (check_required()==0){ exit; } $invis_array = array('recipient','subject','required','redirect', 'print_blank_fields', 'sort','subject','title', 'page', 'link','css','hidden','alias'); } ?> THANK YOU SO MUCH FOR ANY HELP AT ALL!
  12. Hello.  I've seen that questions similar to this are on other areas of the board, however do to my embarrassing non-familiarity with php, they aren't much help because my skills are limited to copy and paste.  If someone could help with this simple modification I would be incredibly greatful! I've created (through putting together other tutorials) a php script and accompanying HTML code that successfully emails information filled out in form to a specified email address.  The page can be found <A HREF = "http://jellywars.com/brbtest/info.html">here</A>, where you can look at the source.  The php code is pasted below... [code] <? // ------------- CONFIGURABLE SECTION ------------------------ $mailto = 'bigredbutton@gmail.com' ; $subject = "CustomGameOrder" ; $formurl = "http://www.jellywars.com/brbtest/info.html" ; $errorurl = "http://http://www.jellywars.com/brb/error.html" ; $thankyouurl = "http://www.jellywars.com/brbtest/info.html" ; $uself = 0; // -------------------- END OF CONFIGURABLE SECTION --------------- $headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ; $name = $_POST['name'] ; $email = $_POST['email'] ; $email2 = $_POST['email2'] ; $lastname = $_POST['lastname'] ; $gender = $_POST['gender'] ; $mom = $_POST['mom'] ; $dad = $_POST['dad'] ; $hobby = $_POST['hobby'] ; $neighborhood = $_POST['neighborhood'] ; $message1 = $_POST['message1'] ; $message2 = $_POST['message2'] ; $message3 = $_POST['message3'] ; $finalmessage = $_POST['finalmessage'] ; $comments = $_POST['comments'] ; $http_referrer = getenv( "HTTP_REFERER" ); if (!isset($_POST['email'])) {   header( "Location: $formurl" );   exit ; } if (empty($name) || empty($email)) {   header( "Location: $errorurl" );   exit ; } if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) {   header( "Location: $errorurl" );   exit ; } if (get_magic_quotes_gpc()) {   $comments = stripslashes( $comments ); } $messageproper =   "This message was sent from:\n" .   "$http_referrer\n" .   "------------------------------------------------------------\n" .   "FirstName: $name\n" .   "LastName: $lastname\n" .   "Gender: $gender\n" .   "Mom: $mom\n" .   "Dad: $dad\n" .   "Hobby: $hobby\n" .   "Neighborhood: $neighborhood\n" .   "Message1: $message1\n" .   "Message2: $message2\n" .   "Message3: $message3\n" .   "FinalMessage: $finalmessage\n" .   "Email of sender: $email\n" .   "Confirm Email: $email2\n" .   "------------------------- COMMENTS -------------------------\n\n" .   $comments .   "\n\n------------------------------------------------------------\n" ; mail($mailto, $subject, $messageproper,   "From: \"$lastname\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" ); header( "Location: $thankyouurl" ); exit ; ?> [/code] I need to add on to this script so that it handles sending images files also (preferably 3 separate images).  I know that this is no small task, but I'm sure it's been done before.  If someone could point me in the direction of some code that I can combine with this code, then that would be fantastic.  Thank you so much for your time!
  13. That's perfect!  I knew it was probably something simple that I wouldn't be able to find. Thank you so much! 
  14. Hello.  I'm trying to create a mailing form for my business webpage by modifying and expanding a free php script that I found online.  I only added some new vars and forms, but for some reason the new code doesn't seem to work.  I wanted to see if someone could skim the two pages and try to find what the crucial difference is that makes the original script work and the modified one fail (When I click send on the modified script, it sends me to the  w3.org site for some reason). The page that works (code off of thesitewizard.com) can be found <A HREF = "http://www.jellywars.com/brb/contact.html">here</A>.  Feel free to view the source to see what's going on. the following is the php code to go along with that form. [code] <? // ------------- CONFIGURABLE SECTION ------------------------ $mailto = 'bigredbutton@gmail.com' ; $subject = "BigRedButton Feedback" ; $formurl = "http://www.jellywars.com/brb/contact.html" ; $errorurl = "http://http://www.jellywars.com/brb/error.html" ; $thankyouurl = "http://www.jellywars.com/brb/thanksfeedback.html" ; $uself = 0; // -------------------- END OF CONFIGURABLE SECTION --------------- $headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ; $name = $_POST['name'] ; $email = $_POST['email'] ; $comments = $_POST['comments'] ; $http_referrer = getenv( "HTTP_REFERER" ); if (!isset($_POST['email'])) { header( "Location: $formurl" ); exit ; } if (empty($name) || empty($email) || empty($comments)) {   header( "Location: $errorurl" );   exit ; } if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) { header( "Location: $errorurl" ); exit ; } if (get_magic_quotes_gpc()) { $comments = stripslashes( $comments ); } $messageproper = "This message was sent from:\n" . "$http_referrer\n" . "------------------------------------------------------------\n" . "Name of sender: $name\n" . "Email of sender: $email\n" . "------------------------- COMMENTS -------------------------\n\n" . $comments . "\n\n------------------------------------------------------------\n" ; mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" ); header( "Location: $thankyouurl" ); exit ; ?> [/code] The page that doesn't work, which uses my modified code adding more forms, can be found <A HREF = "http://jellywars.com/brbtest/info.html">here</A>  The php script, also modified, is below. [code] <? // ------------- CONFIGURABLE SECTION ------------------------ $mailto = 'bigredbutton@gmail.com' ; $subject = "CustomGameOrder" ; $formurl = "http://www.jellywars.com/brbtest/info.html" ; $errorurl = "http://http://www.jellywars.com/brb/error.html" ; $thankyouurl = "http://www.jellywars.com/brbtest/info.html" ; $uself = 0; // -------------------- END OF CONFIGURABLE SECTION --------------- $headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ; $name = $_POST['name'] ; $email = $_POST['email'] ; $email2 = $_POST['email2'] ; $lastname = $_POST['lastname'] ; $gender = $_POST['gender'] ; $mom = $_POST['mom'] ; $dad = $_POST['dad'] ; $hobby = $_POST['hobby'] ; $neighborhood = $_POST['neighborhood'] ; $message1 = $_POST['message1'] ; $message2 = $_POST['message2'] ; $message3 = $_POST['message3'] ; $finalmessage = $_POST['finalmessage'] ; $comments = $_POST['comments'] ; $http_referrer = getenv( "HTTP_REFERER" ); if (!isset($_POST['email'])) { header( "Location: $formurl" ); exit ; } if (empty($name) || empty($email) || empty($comments)) {   header( "Location: $errorurl" );   exit ; } if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) { header( "Location: $errorurl" ); exit ; } if (get_magic_quotes_gpc()) { $comments = stripslashes( $comments ); } $messageproper = "This message was sent from:\n" . "$http_referrer\n" . "------------------------------------------------------------\n" . "FirstName: $name\n" . "LastName: $lastname\n" . "Gender: $gender\n" . "Mom: $mom\n" . "Dad: $dad\n" . "Hobby: $hobby\n" . "Neighborhood: $neighborhood\n" . "Message1: $message1\n" . "Message2: $message2\n" . "Message3: $message3\n" . "FinalMessage: $finalmessage\n" . "Email of sender: $email\n" . "Confirm Email: $email2\n" . "------------------------- COMMENTS -------------------------\n\n" . $comments . "\n\n------------------------------------------------------------\n" ; mail($mailto, $subject, $messageproper, "From: \"$lastname\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" ); header( "Location: $thankyouurl" ); exit ; ?> [/code] Does anyone know why the first page works and the second page doesn't?  What can I do to make the second page correctly send me an email?  Also, I apologize if this question isn't appropriate for this section...I saw the "how do I mail something" post in the FAQ section.  However, I don't need to know how to write new code, I need to know what's wrong with this code I already have.  I also am not very experienced at all with PHP (The additions were made with my understanding of HTML, C++, Java, etc). Thank you all so much for your time!
×
×
  • 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.