Jump to content

jfourman

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jfourman's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Andrew: Thank you for your reply. The code I am hacking is from an "include" in an ecommerce app page named updateorder.php. My include is called updateorderform.php. I substituted the "print" command with the "header" command you suggested and was returned the error: Warning: Cannot modify header information - headers already sent by (output started at /home/store/www/dev/orderupdate.php:10) in /home/store/www/dev/orderupdateform.php on line 226 I am trying to substitute the "print" at the end of the include code with navigation to a success.php page. I tried to change the "action" in my form to the success.php page; but although this appears to work, the confirmation emails after the "submit" fail to send. This all works with the "print" statement...but stays on the same page after sending the emails. I want to show a new page. Is there anything I can use other than the "Header" statement. Thank you again for your help.
  2. I am embarrased to ask this question because I know the answer is simple; but I have been looking for examples and can't find the solution. I have a form that upon 'submit' performs some PHP code to send confirmation emails. At the end of the PHP code, a "print" message is displayed on the same page acknowledging that the emails have been sent. Instead of displaying the message on the same page, I want to load a new page to display the confirmation message. I can't figure out what code to use to replace the "print" command with a command that will navigate to a new page instead. The navigation has to be automatic...no button press. I'm obviously a noobie that is very grateful for your help.
  3. I'm hacking at an ecommerce template to make some minor customizations. I am having trouble validating the value of a radio button in a form. I can print the value in the PHP code and it displays correctly. I just don't know how to write the "if" statement in the script to evaluate the value. The code below is just a test to display an alert message; but if the "Image Upload" button is selected, it doesn't display the alert. Do I need to do a string function on the "updatetype" variable first? The printf statement prints "Image Upload". I get the script and form to work if I am testing the value of a text box input. It's the radio button that is giving me problems. Script: (I left out the JS header since my message wouldn't post with it included): <!-- function checkform(theForm) {   if (theForm.updatetype.value == "Image Upload")   {     alert("<?php print "Radio Button is Image Upload."?>");     return (false);   }   return (true); } //--> </script> <form action='orderupdate.php' method="POST" onsubmit="return checkform(this)">     <table width="100%"  border="0" cellspacing="0" cellpadding="0">           <tr>             <td><input type="radio" name="updatetype" value="<? echo("Image Upload"); ?>">               Upload an image</label></td>           </tr>           <tr>             <td><input type="radio" name="updatetype" value="<? echo("Change Request"); ?>">               Request a change to my order</label></td>           </tr>           <tr>             <td><input type="radio" name="updatetype" value="<? echo("Cancellation Request"); ?>">               Cancel my order</label></td>           </tr>           <tr>             <td>   <input type='submit' name='send' value='Send Order Update'>             </td>           </tr>       </table> </form> <?php         printf ($updatetype); ?> Thank you for your help.
  4. Now I understand, thanks onlyican. In fact, the example I was using that did not echo the variable was echoing the form. Got it!
  5. ;D Yipee! I am soooo grateful for your help. Jeremysr: you're solution was on the mark! I tried all 3 of onlyican's options; but they still just displayed what ever was in the quotes rather than the value of the variable. I had fooled around with this problem for 6 hours reading and trying options before posting my question here. With your help, it was solved in a minute. In reading my Programming PHP book to understand why the ?echo was required I now see that the echo() command puts the string from the PHP generated page into the HTML. I have a lot more learning to do. Thank you for teaching me something!
  6. This is my first attempt to use the FORM POST method. My problem is that the receiving $_POST variable is getting the value equal to the POST'ed variable name (not the actual value of the variable). form method="POST" page code: <form action="orderupdate.php" enctype='multipart/form-data' method="POST"> <input type="hidden" name="order_id" value=$ordid>   <input type="hidden" name="email_addr" value=$email>   <input type="hidden" name="order_status" value=$statPublic> <p align="center"><input name="Update Order" type="submit" value="Update Order" align="middle"></p> </form> orderupdate.php code: <?$order_id = $_POST['order_id'];?> <?$email_addr = $_POST['email_addr'];?> <?$order_status = $_POST['order_status'];?> <p><?printf ($order_id);?></p> <p><?printf ($email_addr);?></p> <p><?printf ($order_status);?></p> The printf statements display the values: "$ordid $email $statPublic" rather than the actual values of the fields. If I add a printf statement to the "POSTing" form after the inputs, the value shows correctly (e.g. email_addr = dave@phpfreaks.com. If I change the input tag from type='hidden' to type='text' and enter a value, the value POSTs and displays correctly on the updateorder.php page. So I know the POST is working. It seems that the type='hidden' is my problem? I did get the transfer of the variable values to work with the GET method, but I don't want the values to be part of the URL. I prefer to get the POST method to work. ???Thank you for your help.
×
×
  • 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.