Jump to content

imimin

Members
  • Posts

    119
  • Joined

  • Last visited

    Never

Everything posted by imimin

  1. OK, got it! Area right after email line added. I figured this out by modifying 'PFMaBiSmAd's' last code! <?php $fields = array(); $fields["Id_From"] = "ID_From:"; $fields["ID"] = "ID:"; $fields["CUT"] = "Cut:"; $fields["MAKE"] = "Make:"; $fields["CARAT"] = "Carats:"; $fields["PRICE_PC"] = "Price per carat:"; $fields["CLARITY"] = "Clarity:"; $fields["LOCATION"] = "Location:"; $fields["CERTIFICATE"] = "Certificate:"; $fields["SUP_STOCK_REF"] = "Sup Stock Ref:"; $fields["Measurements"] = "Measurments:"; $fields["Total_Depth"] = "Total Depth"; $fields["Polish"] = "Polish:"; $fields["Table_Width"] = "Table Width:"; $fields["Symmetry"] = "Symmetry:"; $fields["Crown_Height"] = "Crown Height:"; $fields["Culet"] = "Culet:"; $fields["Parillion_Depth"] = "Parillion Depth:"; $fields["Graining"] = "Graining:"; $fields["Girdle"] = "Girdle:"; $fields["Remarks"] = "Remarks:"; $fields["TotalPrice"] = "Total Price:"; // form processing code, detect if the first (expected) get parameter is present if(isset($_GET["Id_From"])){ $errors = array(); // array to hold any validation errors // validate all the expected data here ... // process the data if no validation errors if(empty($errors)){ // loop over the expected fields and form the mail message $message = ''; // define variable/empty message foreach($fields as $key => $label){ $message .= "$label: $_GET[$key]\n"; } $message = wordwrap($message, 70); if(mail('gary.impact@gmail.com', 'HIGH PRIORITY DIAMOND ORDER/INQUIRY!', $message)){ echo 'Additional test text here!'; // Text before diamond data here. echo "<br />"; echo "<br />"; foreach($fields as $key => $label){ $message2 .= "<label for='$key'>$label:$_GET[$key]<br />\n"; } echo $message2; echo "<br />"; echo "Thank you for your interest in our products! Your loose diamond order will be validated and checked for errors. We should be back with you within 24 to 48 hours at which time we will need to accept payment and process your order. Thank you!"; //Text after diamond data here. } else { echo "Sending Main server rejected the email!"; } } } ?>
  2. Thank you! Your code above returns text boxes instead of my extracted values (which are sent to the emails): $form = "<form method='get' action=''>\n"; foreach($fields as $key => $label){ $form .= "<label for='$key'>$label:</label>\n<input type='text' id='$key' name='$key' value=''><br />\n"; } $form .= "<input type='submit'>\n</form>"; echo $form; What I would like to do is give the customer confirmation of his request. I have tried the following with various formats (see first "echo" area for changes): <?php $fields = array(); $fields["Id_From"] = "ID_From:"; $fields["ID"] = "ID:"; $fields["CUT"] = "Cut:"; $fields["MAKE"] = "Make:"; $fields["CARAT"] = "Carats:"; $fields["PRICE_PC"] = "Price per carat:"; $fields["CLARITY"] = "Clarity:"; $fields["LOCATION"] = "Location:"; $fields["CERTIFICATE"] = "Certificate:"; $fields["SUP_STOCK_REF"] = "Sup Stock Ref:"; $fields["Measurements"] = "Measurments:"; $fields["Total_Depth"] = "Total Depth"; $fields["Polish"] = "Polish:"; $fields["Table_Width"] = "Table Width:"; $fields["Symmetry"] = "Symmetry:"; $fields["Crown_Height"] = "Crown Height:"; $fields["Culet"] = "Culet:"; $fields["Parillion_Depth"] = "Parillion Depth:"; $fields["Graining"] = "Graining:"; $fields["Girdle"] = "Girdle:"; $fields["Remarks"] = "Remarks:"; $fields["TotalPrice"] = "Total Price:"; // form processing code, detect if the first (expected) get parameter is present if(isset($_GET["Id_From"])){ $errors = array(); // array to hold any validation errors // validate all the expected data here ... // process the data if no validation errors if(empty($errors)){ // loop over the expected fields and form the mail message $message = ''; // define variable/empty message foreach($fields as $key => $label){ $message .= "$label: $_GET[$key]\n"; } $message = wordwrap($message, 70); if(mail('gary.impact@gmail.com', 'HIGH PRIORITY DIAMOND ORDER/INQUIRY!', $message)){ echo $message = ''; // define variable/empty message foreach($fields as $key => $label){ $message .= "$label: $_GET[$key]\n"; } echo $message; echo "Thank you for your interest in our products! Your loose diamond order will be validated and checked for errors. We should be back with you within 24 to 48 hours at which time we will need to accept payment and process your order. Thank you!"; } else { echo "Sending Main server rejected the email!"; } } } ?> but I am obviously doing something wrong in the syntax since the list prints in the customers view but the line breaks (\n) are ignored? I first just put in the "echo $message;" line and got same results. That is why I tried re-entering the code above it to try to get the formatting I wanted. Can you tell me what I am doing wrong? Thank you!
  3. Thank you! How can the list of fields be printed along with "echo "Sending Main server rejected the email!";" line? I may like to put text before and after the 'list of fields'. My final objective will be to have all this information print to my customers web page with the option to print as well as email me a copy (which we have already accomplished). Thanks!
  4. Thanks for all of your help guys! I appreciate all of the information, it will help me learn this stuff! PFMaBiSmAd, your post polished it off, thanks a lot!
  5. Do you mind showing me how to set that array up based on the info given above? Thank you!
  6. Thanks! OK, now we are getting somewhere. BUT I need to put each returned value on a line of its own? Can that be done?
  7. I tried just putting one line on like this: <?php // The message $message = $_GET['TotalPrice']; and it works fine. If I add one more line like this: <?php // The message $message = $_GET['TotalPrice']; $_GET['CARAT']; It still ONLY prints the first line? If I enclose it in anything (', ", (), etc) like: <?php // The message $message ="[/color] $_GET['TotalPrice']; $_GET['CARAT'];"[/color] it gives me an error
  8. Thanks for the reply! I tried your format and am getting the error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING on line 4 :-) !
  9. Hello! I have the following php code: <?php // The message $message = "[request("Id_From")]\n [request("ID")]\n [request("CUT")]\n [request("MAKE")]\n [request("CARAT")]\n [request("PRICE_PC")]\n [request("CLARITY")]\n [request("LOCATION")]\n [request("CERTIFICATE")]\n [request("SUP_STOCK_REF")]\n [request("Measurements")]\n [request("Total_Depth")]\n [request("Polish")]\n [request("Table_Width")]\n [request("Symmetry")]\n [request("Crown_Height")]\n [request("Culet")]\n [request("Parillion_Depth")]\n [request("Graining")]\n [request("Girdle")]\n [request("Remarks")]\n [request("TotalPrice")]"; // In case any of our lines are larger than 70 characters, we should use wordwrap() $message = wordwrap($message, 70); // Send mail('gary.impact@gmail.com', 'HIGH PRIORITY DIAMOND ORDER!', $message); ?> where I am trying to send an email to myself which will send me the listed 'requested' values. These values are to the script in the form of: http://www.somedomain.com/somepage.html?Id_From=123&ID=50250430&CUT=Round&MAKE=VG+-+G++++&CARAT=.5&PRICE_PC=5719&COLOR=D&CLARITY=VVS1&LOCATION=California+%28U.S.A.%29&CERTIFICATE=GIA&SUP_STOCK_REF=3540-6&Measurements=5.03x5.08x3.17&Total_Depth=62.7%25&Polish=V.good&Table_Width=60%25&Symmetry=Good&Crown_Height=&Culet=None&Parillion_Depth=&Graining=&Girdle=&Fluorescence=None&Remarks=&TotalPrice=2860 I am getting the error: Parse error: syntax error, unexpected T_STRING Which starts on the first line of my requested data ("[request("Id_From")]\n). Any help on this would be truely appreciated! Thank you!
  10. p2grace, are you saying I can use the above code to "receive" the data sent from the link in the format of: ???
  11. Now, is there a way to set this up in a link? Such as : <A HREF="<http://www.anysite.com . "?" . "cat=" . "red, blue,yellow">" TITLE="">TEST PAGE</A>
  12. Is there a way to write a SQL statement with a WHERE clause which contains more than one condition? Such as : SELECT prod_name FROM products WHERE cat=red, blue,yellow Thank you!
  13. Sorry! I just found an error in my DB data! The table I was pulling out was getting truncated somehow leaving out the end table tag! That would certainly cause the problem I was experiencing. Thank you for your time in this matter-I am sorry it bore no fruit !
  14. If I put plain text in this <TD> it works fine. Is there a way to reformat to make the variable data to work?
  15. "<table border=""1"" width=""100%"" cellpadding=""1"" cellspacing=""1""> <tr> <td align=""left""> Size/<BR> Approximate<BR>Age Range </td> <td align=""left""> Toddler<BR>2/3</td> <td align=""left""> Small<BR>4/5</td> <td align=""left""> Medium<BR>7/8</td> <td align=""left""> Large<BR>9/10</td> <td align=""left""> Extra Large<BR>12/14</td> </tr> <tr> <td align=""left""> Waist (inches)</td> <td align=""left"">18-22</td> <td align=""left"">20-24</td> <td align=""left"">22-26</td> <td align=""left"">24-28</td> <td align=""left"">26-28</td> </tr> <tr> <td align=""left""> Inseam (inches)</td> <td align=""left"">13</td> <td align=""left"">16</td> <td align=""left"">17</td> <td align=""left"">18</td> <td align=""left"">19</td> </tr> </table> "
  16. I placed a new table inside a <td> in the code below (where the "*****NEW TABLE HERE VIA DB($adult_size_chart)*****" text is) and it works fine as long as I don't have it inside a heredoc. If I put it in a heredoc it does funky stuff to the rest of my table??? echo <<<HTML <input type='hidden' name='name' value='$prod_name' /> <input type='hidden' name='price' value='$price' /> <input type='hidden' name='sh' value='$weight' /> <input type='hidden' name='img' value='https://secure.impact-impressions.com/poj/includes/img_resize3.php?src=$sitelocation$img&width=100&height=100&qua=50' /> <input type='hidden' name='img2' value='' /> <input type='hidden' name='return' value='http://www.patternsofjoy.com/order_more.php' /> <input type='RADIO' name='custom20' value='Style: $selected_style' checked='checked' style='display: none' /> <strong>Garment Style: </strong>$selected_style <br /> <a href="http://www.patternsofjoy.com/order_more.php" TITLE="Click here to change Garement Style">***Change Garment Style***</a> </TD> </TR> <TR> <TD> <B>Size Range:</B><BR> <INPUT TYPE="RADIO" NAME=custom30 VALUE="Size Range: Adult +$2.00"> Adult (Add $2.00) <BR> <INPUT TYPE="RADIO" NAME=custom30 VALUE="Size Range: Child"> Child<BR> </TD> *****NEW TABLE HERE VIA DB($adult_size_chart)***** </tr> <tr> <td> <strong>Garment Size:</strong> <select id="custom40" name="custom40" size='5'> <option value="Size: Small (S)">Small (S)</option> <option value="Size: Medium (M)">Medium (M)</option> <option value="Size: Large (L)">Large (L)</option> <option value="Size: Extra Large (L)">Extra Large (L)</option> <option value="Size: Toddler (T)">Toddler (T)</option> </select><br /> <a href="javascript:newwindow2();" >Garment Measuring Tips</a> </td> </tr> HTML;
  17. How could I auto-increment the numeral between the brackets on line 10 of the below code (fadeimages[0]) so the nuneral increases by 1 for each iteration (starting with numeral 0)? Example, if I have 3 iterations the output would look like: fadeimages[0]=["photo1.jpg", "", ""] fadeimages[1]=["photo2.jpg", "", ""] fadeimages[2]=["photo3.jpg", "", ""] <?php /*$cat = mysql_real_escape_string($_GET['cat']);*/ $cat='all'; $get_items = "SELECT * FROM poj_products WHERE cat='$cat'"; $get_items = mysql_query($get_items); while($item_row = mysql_fetch_assoc($get_items)) { extract($item_row); echo 'fadeimages[0]=["http://www.patternsofjoy.com/images/thumbs/'.$item_row['img-no_path'].'", "", ""]'; '\n'; } ?> Thank you!
  18. Thanks, that did the trick! I really appreciate all of your help! I will mark the problem 'solved'!
  19. Being generated server side so when you look at source on a web browser you see it. It's the first part of a JS. I know the code works with the JS, my only problem is at this point to get it to print correctly to: fadeimages[0]=["http://www.patternsofjoy.com/images/thumbs/POJ00210.jpg", "", ""] fadeimages[1]=["http://www.patternsofjoy.com/images/thumbs/POJ00222.jpg", "", ""] fadeimages[2]=["http://www.patternsofjoy.com/images/thumbs/POJ00224.jpg", "", ""]
  20. I just ordered a good book on the subject, looking for ward to it ! Just tried the last code you gave me and now I get this as an output: fadeimages[0]=["http://www.patternsofjoy.com/images/thumbs/POJ00241.jpg", "", ""]\nfadeimages[0]=["http://www.patternsofjoy.com/images/thumbs/POJ00256.png", "", ""]
  21. Thank you! I set it up like this: <?php /*$cat = mysql_real_escape_string($_GET['cat']);*/ $cat='all'; $get_items = "SELECT * FROM poj_products WHERE cat='$cat'"; $get_items = mysql_query($get_items); while($item_row = mysql_fetch_assoc($get_items)) { extract($item_row); echo 'fadeimages[0]=["http://www.patternsofjoy.com/images/thumbs/'.$item_row['img-no_path'].'", "", ""]'; \n; } ?> and I am still getting: fadeimages[0]=["http://www.patternsofjoy.com/images/thumbs/POJ00241.jpg", "", ""]fadeimages[0]=["http://www.patternsofjoy.com/images/thumbs/POJ00256.png", "", ""]fadeimages[0]=["http://www.patternsofjoy.com/images/thumbs/POJ00257.png", "", ""]
  22. I just need my output to print like this: fadeimages[0]=["http://www.patternsofjoy.com/images/thumbs/POJ00210.jpg", "", ""] fadeimages[1]=["http://www.patternsofjoy.com/images/thumbs/POJ00222.jpg", "", ""] fadeimages[2]=["http://www.patternsofjoy.com/images/thumbs/POJ00224.jpg", "", ""] maybe my choice of words was not correct when I mentioned putting a <BR> between each line. I just assumed that is what I needed to get the output to look like the above output?
  23. Now its printing out like this: fadeimages[0]=["http://www.patternsofjoy.com/images/thumbs/POJ00241.jpg", "", ""]<br />fadeimages[0]=["http://www.patternsofjoy.com/images/thumbs/POJ00256.png", "", ""]
  24. Thank you! When I tried that: <?php /*$cat = mysql_real_escape_string($_GET['cat']);*/ $cat='all'; $get_items = "SELECT * FROM poj_products WHERE cat='$cat'"; $get_items = mysql_query($get_items); while($item_row = mysql_fetch_assoc($get_items)) { extract($item_row); echo 'fadeimages[0]=["http://www.patternsofjoy.com/images/thumbs/'.$item_row['img-no_path'].'", "", ""]'; echo <br />; } ?> I get the following error: Parse error: syntax error, unexpected '<', expecting ',' or ';' in /homepages/27/d120150310/htdocs/poj/slideshow.php on line 33 Which is the 'echo <br />;' line.
×
×
  • 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.