
laflair13
Members-
Posts
86 -
Joined
-
Last visited
Everything posted by laflair13
-
Having a form insert the data in the database.
laflair13 replied to laflair13's topic in PHP Coding Help
I added the code to the page and there were no errors. Again, the form disappeared like it worked. The form came to my email but didnt have the data with it. -
Having a form insert the data in the database.
laflair13 replied to laflair13's topic in PHP Coding Help
I added these to the top of my page but nothing is showing up when I click the submit button, the form just disappears like it is supposed to. <?php error_reporting(E_ALL); ini_set('display_errors', 1); ?> <?php print_r($_POST); ?> -
Having a form insert the data in the database.
laflair13 replied to laflair13's topic in PHP Coding Help
I appreciate the help and I am trying to figure it out. Can you please tell me how I do the error reporting? There is no error though, it just isnt posting the info in the email I receive or the database. Its blank And the missing quote was a typo when I deleted the username. -
Having a form insert the data in the database.
laflair13 replied to laflair13's topic in PHP Coding Help
Ok, I believe I have changed it all to mysqli but it still is coming up blank on the from and in the database <?php include_once('class/class_email.php'); $con = mysqli_connect("localhost","admin","password","database"); $fname = $_POST['fname']; $lname = $_POST['lname']; $email = $_POST['email']; $company = $_POST['company']; $telephone = $_POST['telephone']; $comments = $_POST['comments']; $EID = $_POST['eid']; //$SQL_GetEquipment = "SELECT * FROM `new_equip` WHERE `id`='$EID' LIMIT 1;"; //$R_GetEquipment = mysql_query($SQL_GetEquipment, $Link); //$row = mysql_fetch_assoc($R_GetEquipment); $SQL_GetEquipment = "SELECT * FROM `new_equip` WHERE `id`='$EID' LIMIT 1;"; $result = mysqli_query($connect,$SQL_GetEquipment); $row = mysqli_fetch_assoc($result); $EmailBody = "$fname $lname has requested a quote from NAPE on Item $EID\n Information on quote request: \n Name: $fname $lname \n Email: $email \n Company: $company \n Number: $telephone \n Comments: $comments \n \n Information Requested for: {$row['itemname']}\n The URL to {$row['itemname']} is: http://www.domain.com/new-product.php?Item=$EID \n Click to send a quote now:\n http://www.domain.com/Admin/send-quote.php?id=$EID "; $e = new email(); //First value is the URL of your server, the second the port number $e->set_server( 'mail.domain.com', 26); //First value is your username, then your password $e->set_auth('[email protected]', 'nape112233'); //Set the "From" setting for your e-mail. The Name will be base64 encoded $e->set_sender( 'Quote Requested', '[email protected]' ); //for one recipient //$send_to = array('[email protected]','[email protected]'); $send_to = ('[email protected]'); //you may also specify multiple recipients by creating an array like this: //$send_to = array('[email protected]', '[email protected]', '[email protected]'); $subject = 'Quote Request from NAPE'; $body = "$EmailBody"; if( $e->mail($send_to, $subject, $body, $headers) == true ) { //message was received by the smtp server //['last'] tends to contain the queue id so I like to save that string in the database echo 'last: '.htmlspecialchars($e->srv_ret['last']).''; }else{ //something went wrong echo 'all: '.nl2br(htmlspecialchars($e->srv_ret['all'])).''; echo 'full:'.nl2br(htmlspecialchars($e->srv_ret['full'])).''; } mysqli_query($con,"INSERT INTO users (`id`,`fname`,`lname`,`email`,`company`,`telephone`) VALUES ('$id','$fname','$lname','$email','$company','$telephone')"); ?> -
Having a form insert the data in the database.
laflair13 replied to laflair13's topic in PHP Coding Help
Here is the code for the form and no I dont know how to echo the post. I am brand new to php <form id="contact" name="contact" action="#" method="post" style="width:600px"> <br /> <table width="80%"> <tr> <td width="36%">*First Name:</td> <td width="3%"> </td> <td width="61%"> <input type="text" id="fname" name="fname" /> </td> </tr> <tr> <td width="36%">*Last Name:</td> <td width="3%"> </td> <td width="61%"> <input type="text" id="lname" name="lname" /> </td> </tr> <tr> <td width="36%">Company Name:</td> <td width="3%"> </td> <td width="61%"> <input type="text" id="company" name="company" /> </td> </tr> <tr> <td>*Your E-Mail:</td> <td> </td> <td> <input type="text" id="email" name="email" /> </td> </tr> <tr> <td width="36%">*Phone Number:</td> <td width="3%"> </td> <td width="61%"> <input type="text" id="telephone" name="telephone" /> </td> </tr> <tr> <td width="36%" h>Comments:</td> <td width="3%"> </td> <td width="61%"> <textarea id="comments" name="comments" cols="25" rows="3"></textarea> </td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td width="36%" align="center" colspan="3"> <button id="send">Request Quote</button> </td> </tr> <tr> <td colspan="5"> </td> </tr> <tr> <td width="100%" colospan="3"> <b><?php echo $itemname; ?></b> <br /> <br /> Manufacturer: <?php echo $manufactuer;?> <br /> Model: <?php echo $model;?> <br /> Category: <?php echo $category;?> <br /> </td> </tr> </table> </form> </div> <!-- basic fancybox setup --> <script type="text/javascript"> $(document) .ready(function () { $(".modalbox").fancybox(); $("#contact").submit(function () { return false; }); $("#send").on("click", function () { { // if both validate we attempt to send the e-mail // first we hide the submit btn so the user doesnt click twice $("#send").replaceWith("<em>Your request has been sent...</em>"); $.ajax({ type: "POST", url: "AJAX_Quote.php", data: JSON.stringify({fname: $("#fname").val(),lname: $("#lname").val(),email: $("#email").val(),eid: $("#Form_ID").val(),company: $("#company").val(),telephone: $("#telephone").val(),comments: $("#comments").val()}), dataType: 'json', success: setTimeout(function () { parent.$.fancybox.close(); }, 2000) }); } }); }); </script> -
I almost have it but I am missing something. The form is being sent and the row is being created but there is not data. It is blank. I know it is something simple I am missing but I cannot figure it out If anyone can look at my code below and tell me what I am missing to make the inputed info be seen, I would sure appreciate it. <?php include_once('class/class_email.php'); // contact to database $connect = mysql_connect("localhost", "admin", "password") or die ("Error , check your server connection."); mysql_select_db("database"); $fname = $_POST['fname']; $lname = $_POST['lname']; $email = $_POST['email']; $company = $_POST['company']; $telephone = $_POST['telephone']; $comments = $_POST['comments']; $EID = $_POST['eid']; extract ($_POST); // Pick up the form data and assign it to variables // $id = intval($id); $fname = strip_tags($fname); $lname = strip_tags($lname); $email = strip_tags($email); $company = strip_tags($company); $telephone = intval($telephone); $query="INSERT INTO users(`id`, `fname`, `lname`, `email`,`company`,`telephone`) VALUES('$id','$fname','$lname','$email','$company','$telephone')"; echo $query; mysql_query($query) or die(mysql_error()); echo mysql_error(); $SQL_GetEquipment = "SELECT * FROM `new_equip` WHERE `id`='$EID' LIMIT 1;"; $result = mysqli_query($connect,$SQL_GetEquipment); $row = mysqli_fetch_assoc($result); $EmailBody = "$fname $lname has requested a quote from NAPE on Item $EID\n Information on quote request: \n Name: $fname $lname \n Email: $email \n Company: $company \n Number: $telephone \n Comments: $comments \n \n Information Requested for: {$row['itemname']}\n The URL to {$row['itemname']} is: http://www.mydomain.com.com/new-product.php?Item=$EID \n Click to send a quote now:\n http://www.mydomain.com.com/Admin/send-quote.php?id=$EID "; $e = new email(); //First value is the URL of your server, the second the port number $e->set_server( 'mail.mydomain.com.com', 26); //First value is your username, then your password $e->set_auth('[email protected]', '112233'); //Set the "From" setting for your e-mail. The Name will be base64 encoded $e->set_sender( 'Quote Requested', '[email protected]' ); //for one recipient //$send_to = array('[email protected]','[email protected]'); $send_to = ('[email protected]'); //you may also specify multiple recipients by creating an array like this: //$send_to = array('[email protected]', '[email protected]', '[email protected]'); $subject = 'Quote Request from NAPE'; $body = "$EmailBody"; if( $e->mail($send_to, $subject, $body, $headers) == true ) { //message was received by the smtp server //['last'] tends to contain the queue id so I like to save that string in the database echo 'last: '.htmlspecialchars($e->srv_ret['last']).''; }else{ //something went wrong echo 'all: '.nl2br(htmlspecialchars($e->srv_ret['all'])).''; echo 'full:'.nl2br(htmlspecialchars($e->srv_ret['full'])).''; } ?>
-
I added a search form on my site but I cannot figure out how to add links to the search results. The results are being posted as the item name and the item pages look like this used-product.php?Item=102 I am not understanding how I can have that url match up with my item name. Here is my results.php code In the header <?php include_once('mysql_connect.php'); if (!isset($_POST['search'])) { header ("Location:index.php"); } $search_sql="SELECT * FROM new_equip WHERE itemname LIKE '% " .$_POST ['search'] . " %'"; $search_query=mysql_query($search_sql); if(mysql_num_rows($search_query)!=0) { $search_rs=mysql_fetch_assoc($search_query); } ?> and where the results are being displayed <?phpif (mysql_num_rows($search_query)!=0){ do {?> <p><a href="new-product.php?Item=<?php echo $eid; ?>"><?php echo $search_rs ['itemname']?></a></p> <?php } while ($search_rs=mysql_fetch_assoc($search_query)) ; } else { echo "No Results Found"; } ?> I have been on this and trying to figure out another issue I am having and I cannot figure out either of them. (The other is deleting a row from a table with the click of a link) Any help on this would be greatly appreciated it. I have looked and trial and error all day and I cannot seem to get it.
-
Error text in the corner of my form, but from works?
laflair13 replied to thetechcenter's topic in PHP Coding Help
I am new to this, but if the form goes through, then I suggest getting rid of the "echo" on the bottom of your script. else{ echo "error";} -
Thank You very much. I will give it a shot. **EDIT Nothing happens when I click the "request quote" button on the form. The form doesnt disappear or anything, like its not being clicked. This section <input type="button" class="button" name="Form_Submit" value="Request Quote" />
-
Thats the issue, I dont know how to do that. All I am after is the email has the product name and page url when its sent to me. I can get it to send just the basic "name,email,phone" but I cannot get it to send the product info. Here is my code. Form Code <div id="quote"> <a href="#TB_inline?height=200&width=400&inlineId=TBForm&modal=false" class="thickbox"><img src="images/quote.gif" class="imgquote" width="297" height="72" border="0px" /></a><br /> <div id="TBThanks" style="visibility:hidden;"> <p> Thank you, we will send you a quote shortly. </p> </div><!--ends TBThanks--> <div id="TBForm" class="TBForm" style="visibility:hidden"> <p> <form id="FormTB" action=""> <input type="hidden" id="Form_ID" name="Form_ID" value="<?php echo $eid; ?>" /> <center><strong>Request a Quote</strong></center><br /> <table width="100%"> <tr> <td width="30%">*Your Name:</td><td width="20%"> </td><td width="50%"><input type="text" id="Form_Name" name="Form_Name" /></td> </tr> <tr> <td width="30%">Company Name:</td><td width="20%"> </td><td width="50%"><input type="text" id="Form_Company" name="Form_Company" /></td> </tr> <tr> <td>*Your E-Mail:</td><td> </td><td><input type="text" id="Form_Email" name="Form_Email" /></td> </tr> <tr> <td width="30%">*Phone Number:</td><td width="20%"> </td><td width="50%"><input type="text" id="Form_Number" name="Form_Number" /></td> </tr> <tr><td colspan="3"> </td></tr> <tr> <td width="100%" align="center" colspan="3"> <input type="button" class="button" name="Form_Submit" value="Request Quote" /> </td> </tr> <tr><td colspan="3"> </td></tr> <tr> <td width="100%"> <b><?php echo $itemname; ?></b><br /><br /> Manufacturer: <?php echo $manu;?><br /> Model: <?php echo $model;?><br /> Category: <?php echo $Category;?><br /> </td> </tr> </table> </form> </p> </div><!--ends TBForm--> <br /><br /> </div><!--ends quote--> JS that is in the header <script language="javascript" type="text/javascript"> $(function() { $(".button").click(function() { $.ajax({ type: "POST", url: "AJAX_Quote.php", data: $('form#FormTB').serialize(), dataType: 'json', beforeSend: function() { var name = $("#Form_Name").val(); var email = $("#Form_Email").val(); var eid = $("#Form_ID").val(); var company = $("#Form_Company").val(); var number = $("#Form_Number").val(); var dataString = 'name='+ name + '&email=' + email + '&eid=' + eid + '&Company=' + company + '&Number=' + number; //alert (dataString);return false; if (!name || !email || !message || !eid || !company || !number) { $('#output').html('All fields are required'); return false; } emailpat = /^([a-z0-9])+([\.a-z0-9_-])*@([a-z0-9])+(\.[a-z0-9_-]+)+$/i; if (!emailpat.test(email)) { $('#output').html('The e-mail address is not valid.'); return false; } }, success: function(response) { if (response.status == 'success') { $('#quote').html(''); } $('#output').html(response.errmessage); } }); }); }); </script> and the AJAX_Quote.php <?php include_once('class/class_email.php'); $Name = $_POST['name']; $Email = $_POST['email']; $Company = $_POST['Company']; $Number = $_POST['Number']; $EID = $_POST['eid']; $Location=$_POST['location']; $OurPrice=$_Post['ourprice']; $SQL_GetEquipment = "SELECT * FROM `new_equip` WHERE `id`='$EID' LIMIT 1;"; $R_GetEquipment = mysql_query($SQL_GetEquipment, $Link); $row = mysql_fetch_assoc($R_GetEquipment); $Location = "N/A"; $OurPrice = "N/A"; if (strlen($row['location']) > 0) { $Location = $row['location']; } if (strlen($row['ourprice']) > 0) { $OurPrice = $row['ourprice']; } $EmailBody = "$Name has requested a quote from NAPE \n Information on quote request: \n Name: $Name \n Email: $Email \n Company: $Company \n Number: $Number \n \n Location: $Location \n Our Price: $OurPrice \n \n Send a quote now: http://www.packagingequipment4sale.com/admin/Admin_Quote.php?Email=$Email&EID=$EID "; $e = new email(); //First value is the URL of your server, the second the port number $e->set_server( 'mail.packagingequipment4sale.com', 26); //First value is your username, then your password $e->set_auth('[email protected]', 'nape112233'); //Set the "From" setting for your e-mail. The Name will be base64 encoded $e->set_sender( 'Quote Requested', '[email protected]' ); //for one recipient $send_to = '[email protected]'; //you may also specify multiple recipients by creating an array like this: //$send_to = array('[email protected]', '[email protected]', '[email protected]'); $subject = 'Quote Request from NAPE'; $body = "$EmailBody"; if( $e->mail($send_to, $subject, $body, $headers) == true ) { //message was received by the smtp server //['last'] tends to contain the queue id so I like to save that string in the database echo 'last: '.htmlspecialchars($e->srv_ret['last']).''; }else{ //something went wrong echo 'all: '.nl2br(htmlspecialchars($e->srv_ret['all'])).''; echo 'full:'.nl2br(htmlspecialchars($e->srv_ret['full'])).''; } ?>
-
Basically what I am needing is when a visitor comes to my site and request info on a product, the form sends the product id or name. I have the site set up like product.php?Item=26 and the item number changes based on the product. The page items are being populated with info stored in the mysql databse. I need the email being sent to say something like Basically the "item info" is being pulled from the database. I have asked on different forums and I cannot get a good answer that I can use to make this happen. I might not be explaining it right. Page the form is on is (and all other new-product.php pages) http://www.packagingequipment4sale.com/new-product.php?Item=26 Any help would be greatly appreciated
-
Sorry for the dumb question, but where would I put that? At the very top?
-
I am also trying to do it by changing the .htaccess file but it isn't working either. Trying to use RewriteEngine on RewriteRule ^product-([0-9]+)\.html$ product.php?id=$1
-
Well it changed it but its coming in product.php?Item=Inline%20Tray%20Wrapper
-
Well I am looking to change this url http://website.com/product.php?Item=2369 to http://website.com/product.php?Item=Item-Name Heres a snip of the code that handles that. <?php include_once('mysql_connect.php'); $id = (int)$_GET['Item']; ?> any help would be appreciated.
-
Getting this error now Warning: imagejpeg() [function.imagejpeg]: Unable to open 'http://www.allfoodequip.com/quote/images/3d8ac83f7bcc6c8edffbe3063d353acb.jpg' for writing: No such file or directory in /home/allfoode/public_html/admin/go.php on line 57 Both directed have the 777 permissions.
-
I have changed that, Here is the new updated PHP I can see the place holder for the images, but its like they are not going to the server. <?php $email = $_POST ['email']; $quote = $_POST ['quote']; $item = $_POST ['item']; $inventory = $_POST ['inventory']; $category = $_POST ['category']; $manu = $_POST ['manu']; $model = $_POST ['model']; $condition = $_POST ['condition']; $dimension = $_POST ['dimension']; $desc = $_POST ['desc']; $skidprice = $_POST ['skidprice']; $unitprice = $_POST ['unitprice']; $totalprice = $_POST ['totalprice']; $img1 = $_FILES ['img1']; $img2 = $_FILES ['img2']; $img3 = $_FILES ['img3']; $img4 = $_FILES ['img4']; $img5 = $_FILES ['img5']; function imgReisize($uploadedfile, $Destination, $Thumb){ //this is the function that will resize and copy our images // Create an Image from it so we can do the resize $src = imagecreatefromjpeg($uploadedfile); // Capture the original size of the uploaded image list($width,$height)=getimagesize($uploadedfile); // For our purposes, I have resized the image to be // 600 pixels wide, and maintain the original aspect // ratio. This prevents the image from being "stretched" // or "squashed". If you prefer some max width other than // 600, simply change the $newwidth variable $newwidth=600; $newheight=($height/$width)*600; $tmp=imagecreatetruecolor($newwidth,$newheight); // this line actually does the image resizing, copying from the original // image into the $tmp image imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height); // now write the resized image to disk. I have assumed that you want the // resized, uploaded image file to reside in the ./images subdirectory. $filename = $Destination; imagejpeg($tmp,$filename,100); // For our purposes, I have resized the image to be // 150 pixels high, and maintain the original aspect // ratio. This prevents the image from being "stretched" // or "squashed". If you prefer some max height other than // 150, simply change the $newheight variable $newheight=150; $newwidth=($width/$height)*150; $tmp=imagecreatetruecolor($newwidth,$newheight); // this line actually does the image resizing, copying from the original // image into the $tmp image imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height); // now write the resized image to disk. I have assumed that you want the // resized, uploaded image file to reside in the ./images subdirectory. $filename = $Thumb; imagejpeg($tmp,$filename,100); imagedestroy($src); imagedestroy($tmp); // NOTE: PHP will clean up the temp file it created when the request // has completed. echo "Successfully Uploaded: <img src='".$filename."'>"; } if(isset($_POST[submit])){ $imgNumb=1; //This the "pointer" to images $DestinationDir="./images/"; //Place the destination dir here $ThumbDir="./images/thumbs/"; //Place the thumb dir here while($_FILES["img".$imgNumb][tmp_name]){ $Unique=microtime(); // We want unique names, right? $destination=$DestinationDir.md5($Unique).".jpg"; $thumb=$ThumbDir.md5($Unique).".jpg"; imgReisize($_FILES["img".$imgNumb][tmp_name], $destination, $thumb); $imgNumb++; } } // Always set content-type when sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; // More headers $headers .= 'From: All Food Equipment<sales[MENTION=93556]ALL[/MENTION]foodequip.com>' . "\r\n"; $headers .= "Message-ID: <".$now." sales@".$_SERVER['SERVER_NAME'].">\r\n"; $headers .= "X-Mailer: PHP v".phpversion()."\r\n"; $subject = "Your All Food Equip Quote"; $msg = " <!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\"> <html> <head><link href=\"http://www.allfoodequip.com/admin/quote/style.css\" rel=\"stylesheet\" type=\"text/css\"></head> <body> <div id=\"container\" style=\"width:960px; height:auto; margin:0 auto; border-right: 2px solid #666; border-left: 2px solid #666;\"> <div id=\"header\" style=\"background-image:url([url=http://www.allfoodequip.com/admin/quote/images/banner_bg.jpg);]http://www.allfoodequip.com/admin/quote/images/banner_bg.jpg);[/url] width:100%; height:149px;\"></div> <!--Closes header--> <div id=\"subHead\" style=\"background-image:url([url=http://www.allfoodequip.com/admin/quote/images/menu_bg.jpg);]http://www.allfoodequip.com/admin/quote/images/menu_bg.jpg);[/url] width:100%; height:42px;\"></div> <!--closes subHead--> <div class=\"contents\" style=\"background:#f2f1f1; padding-right: 25px; padding-left: 25px;\"> <h1 style=\"margin:0px;padding:10px 0 5px;font-size:18px;\">Your All Food Equipment Quote:</h1> <table width=\"700\" border=\"0\" class=\"table\" style=\"padding:0px 0px 15px;\"> <tr> <td width=\"119\">Quote #:......................................................... </td> <td width=\"208\">$quote</td> </tr> <tr> <td>Item:..............................................................</td> <td>$item</td> </tr> <tr> <td>Inventory:.......................................................</td> <td>$inventory</td> </tr> <tr> <td>Category:.......................................................</td> <td>$category</td> </tr> <tr> <td>Manufacturer:.................................................</td> <td>$manu</td> </tr> <tr> <td>Model:...........................................................</td> <td>$model</td> </tr> <tr> <td>Condition:......................................................</td> <td>$condition</td> </tr> <tr> <td>Dimension:....................................................</td> <td>$dimension</td> </tr> <tr> <td>Description:...................................................</td> <td>$desc</td> </tr> <br> <tr> <td><b>Skid Price:</b>.................................................</td> <td><b>$skidprice</b></td> </tr> <tr> <td><b>Unit Price:</b>.................................................</td> <td><b>$unitprice</b></td> </tr> <tr> <td><b>Total Price:</b>................................................</td> <td><b>$totalprice</b></td> </tr> </table> <div class=\"t_middle\"> <img name=\"Img\" src=\"$img1\" width=\"177\" height=\"115\" alt=\"Img\" style=\"background-color: #999999\"><img name=\"Img\" src=\"$img2\" width=\"177\" height=\"115\" alt=\"Img\" style=\"background-color: #999999\"><img name=\"Img\" src=\"$img3\" width=\"177\" height=\"115\" alt=\"Img\" style=\"background-color: #999999\"><img name=\"Img\" src=\"$img4\" width=\"177\" height=\"115\" alt=\"Img\" style=\"background-color: #999999\"><img name=\"Img\" src=\"$img5\" width=\"177\" height=\"115\" alt=\"Img\" style=\"background-color: #999999\"> </div> <div class=\"break\" style=\"padding: 15px 0px; width:100%;\"><hr></div> <!--break--> <!--close t_middle--> <div class=\"contactUs\"> <p style=\"color:#650035;\">How to contact us:</p> <ul class=\"contact_list\" style=\"margin:0px;padding:0px;color:#650035;line-height:25px;padding-bottom:30px;list-style:none;\"> <li>Visit us Online: www.allfoodequip.com</li> <li>Contact: Dino Roberts</li> <li>Direct Line: 615-788-2953 </li> <li>Email: [email]dino[MENTION=93556]ALL[/MENTION]foodequip.com[/email]</li> </ul> <ul class=\"contact_list\" style=\"margin:0px;padding:0px;color:#650035;line-height:25px;padding-bottom:30px;list-style:none;\"> <li>All Food Equipment</li> <li>1240 Industrial Park Road</li> <li>Columbia, TN 38401</li> <li>Main Office: 931-490-1977</li> </ul> </div> <p style=\"font-size:14px;color:#333;\">TERMS & CONDITIONS: </p> </div> <!--close m_disc--> <div id=\"footer\" style=\"clear: both; width: 100%; padding: 20px 0 20px 0; text-align: center; border-top: 1px solid #8b8a8b; background: #343233 url([url=http://www.allfoodequip.com/admin/quote/images/footer.jpg]http://www.allfoodequip.com/admin/quote/images/footer.jpg[/url]) no-repeat;\"> <ul class=\"footer_list\" style=\"margin:0px;padding:0px;list-style:none;\"> <li style=\"padding: 0 10px; display: inline; border-right: 1px solid #cccccc;\"><a href=\"http://www.allfoodequip.com\" style=\"color: #cccccc; text-decoration: none;\">Home</a></li> <li style=\"padding: 0 10px; display: inline; border-right: 1px solid #cccccc;\"><a href=\"http://www.allfoodequip.com/new-equipment.php\" style=\"color: #cccccc; text-decoration: none;\">New Equipment</a></li> <li style=\"padding: 0 10px; display: inline; border-right: 1px solid #cccccc;\"><a href=\"http://www.allfoodequip.com/used-equipment.php\" style=\"color: #cccccc; text-decoration: none;\">Used Equipment</a></li> <li style=\"padding: 0 10px; display: inline; border-right: 1px solid #cccccc;\"><a href=\"http://www.allfoodequip.com/services.php\" style=\"color: #cccccc; text-decoration: none;\">Services</a></li> <li style=\"padding: 0 10px; display: inline; border-right: 1px solid #cccccc;\"><a href=\"http://www.allfoodequip.com/about-us.php\" style=\"color: #cccccc; text-decoration: none;\">About Us</a></li> <li class=\"last\" style=\"padding:0 10px;display:inline;border-right:none;\"><a href=\"http://www.allfoodequip.com/contact-us.php\" style=\"color: #cccccc; text-decoration: none;\">Contact Us</a></li> </ul> <div class=\"margin_bottom_10\"></div><br> <span style=\"color:#FFF;\">Copyright © 2010 </span> - <a href=\"http://www.allfoodequip.com\"><font color=\"#FFFFCC\">All Food Equipment</font></a> <div class=\"margin_bottom_10\"></div> <!-- end of footer --> </div> <!--container--> </div> </body> </html> "; // MAIL SUBJECT $subject = "Your All Food Equip Quote"; // TO MAIL ADDRESS $to="$email"; mail($to, $subject, $msg, $headers); // Redirect header("Location: Admin.php?Msg=Sent"); ?>
-
Hey All, I am having issues understanding how this works. I am trying to do a quote and send out 5 images of the product. I cannot seem to get how I get the images sent with the email. If anyone can take a look I would greatly appreciate it. PHP <?php $email = $_POST ['email']; $quote = $_POST ['quote']; $item = $_POST ['item']; $inventory = $_POST ['inventory']; $category = $_POST ['category']; $manu = $_POST ['manu']; $model = $_POST ['model']; $condition = $_POST ['condition']; $dimension = $_POST ['dimension']; $desc = $_POST ['desc']; $skidprice = $_POST ['skidprice']; $unitprice = $_POST ['unitprice']; $totalprice = $_POST ['totalprice']; $img1 = $_POST ['img1']; $img2 = $_POST ['img2']; $img3 = $_POST ['img3']; $img4 = $_POST ['img4']; $img5 = $_POST ['img5']; //Get the uploaded file information $name_of_uploaded_file = basename($_FILES['uploaded_file']['name']); //get the file extension of the file $type_of_uploaded_file = substr($name_of_uploaded_file, strrpos($name_of_uploaded_file, '.') + 1); $size_of_uploaded_file = $_FILES["uploaded_file"]["size"]/1024;//size in KBs //Validations if($size_of_uploaded_file > $max_allowed_file_size ) { $errors .= "\n Size of file should be less than $max_allowed_file_size"; } //------ Validate the file extension ----- $allowed_ext = false; for($i=0; $i<sizeof($allowed_extensions); $i++) { if(strcasecmp($allowed_extensions[$i],$type_of_uploaded_file) == 0) { $allowed_ext = true; } } if(!$allowed_ext) { $errors .= "\n The uploaded file is not supported file type. ". " Only the following file types are supported: ".implode(',',$allowed_extensions); } //copy the temp. uploaded file to uploads folder $path_of_uploaded_file = $upload_folder . $name_of_uploaded_file; $tmp_path = $_FILES["uploaded_file"]["tmp_name"]; if(is_uploaded_file($tmp_path)) { if(!copy($tmp_path,$path_of_uploaded_file)) { $errors .= '\n error while copying the uploaded file'; } } // Always set content-type when sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; // More headers $headers .= 'From: All Food Equipment<[email protected]>' . "\r\n"; $headers .= "Message-ID: <".$now." sales@".$_SERVER['SERVER_NAME'].">\r\n"; $headers .= "X-Mailer: PHP v".phpversion()."\r\n"; $subject = "Your All Food Equip Quote"; $msg = " <!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\"> <html> <head><link href=\"http://www.allfoodequip.com/admin/quote/style.css\" rel=\"stylesheet\" type=\"text/css\"></head> <body> <div id=\"container\" style=\"width:960px; height:auto; margin:0 auto; border-right: 2px solid #666; border-left: 2px solid #666;\"> <div id=\"header\" style=\"background-image:url(http://www.allfoodequip.com/admin/quote/images/banner_bg.jpg); width:100%; height:149px;\"></div> <!--Closes header--> <div id=\"subHead\" style=\"background-image:url(http://www.allfoodequip.com/admin/quote/images/menu_bg.jpg); width:100%; height:42px;\"></div> <!--closes subHead--> <div class=\"contents\" style=\"background:#f2f1f1; padding-right: 25px; padding-left: 25px;\"> <h1 style=\"margin:0px;padding:10px 0 5px;font-size:18px;\">Your All Food Equipment Quote:</h1> <table width=\"700\" border=\"0\" class=\"table\" style=\"padding:0px 0px 15px;\"> <tr> <td width=\"119\">Quote #:......................................................... </td> <td width=\"208\">$quote</td> </tr> <tr> <td>Item:..............................................................</td> <td>$item</td> </tr> <tr> <td>Inventory:.......................................................</td> <td>$inventory</td> </tr> <tr> <td>Category:.......................................................</td> <td>$category</td> </tr> <tr> <td>Manufacturer:.................................................</td> <td>$manu</td> </tr> <tr> <td>Model:...........................................................</td> <td>$model</td> </tr> <tr> <td>Condition:......................................................</td> <td>$condition</td> </tr> <tr> <td>Dimension:....................................................</td> <td>$dimension</td> </tr> <tr> <td>Description:...................................................</td> <td>$desc</td> </tr> <br> <tr> <td><b>Skid Price:</b>.................................................</td> <td><b>$skidprice</b></td> </tr> <tr> <td><b>Unit Price:</b>.................................................</td> <td><b>$unitprice</b></td> </tr> <tr> <td><b>Total Price:</b>................................................</td> <td><b>$totalprice</b></td> </tr> </table> <div class=\"t_middle\"> <img name=\"Img\" src=\"$img1\" width=\"177\" height=\"115\" alt=\"Img\" style=\"background-color: #999999\"><img name=\"Img\" src=\"$img2\" width=\"177\" height=\"115\" alt=\"Img\" style=\"background-color: #999999\"><img name=\"Img\" src=\"$img3\" width=\"177\" height=\"115\" alt=\"Img\" style=\"background-color: #999999\"><img name=\"Img\" src=\"$img4\" width=\"177\" height=\"115\" alt=\"Img\" style=\"background-color: #999999\"><img name=\"Img\" src=\"$img5\" width=\"177\" height=\"115\" alt=\"Img\" style=\"background-color: #999999\"> </div> <div class=\"break\" style=\"padding: 15px 0px; width:100%;\"><hr></div> <!--break--> <!--close t_middle--> <div class=\"contactUs\"> <p style=\"color:#650035;\">How to contact us:</p> <ul class=\"contact_list\" style=\"margin:0px;padding:0px;color:#650035;line-height:25px;padding-bottom:30px;list-style:none;\"> <li>Visit us Online: www.allfoodequip.com</li> <li>Contact: Dino Roberts</li> <li>Direct Line: 615-788-2953 </li> <li>Email: [email protected]</li> </ul> <ul class=\"contact_list\" style=\"margin:0px;padding:0px;color:#650035;line-height:25px;padding-bottom:30px;list-style:none;\"> <li>All Food Equipment</li> <li>1240 Industrial Park Road</li> <li>Columbia, TN 38401</li> <li>Main Office: 931-490-1977</li> </ul> </div> <p style=\"font-size:14px;color:#333;\">TERMS & CONDITIONS: </p> </div> <!--close m_disc--> <div id=\"footer\" style=\"clear: both; width: 100%; padding: 20px 0 20px 0; text-align: center; border-top: 1px solid #8b8a8b; background: #343233 url(http://www.allfoodequip.com/admin/quote/images/footer.jpg) no-repeat;\"> <ul class=\"footer_list\" style=\"margin:0px;padding:0px;list-style:none;\"> <li style=\"padding: 0 10px; display: inline; border-right: 1px solid #cccccc;\"><a href=\"http://www.allfoodequip.com\" style=\"color: #cccccc; text-decoration: none;\">Home</a></li> <li style=\"padding: 0 10px; display: inline; border-right: 1px solid #cccccc;\"><a href=\"http://www.allfoodequip.com/new-equipment.php\" style=\"color: #cccccc; text-decoration: none;\">New Equipment</a></li> <li style=\"padding: 0 10px; display: inline; border-right: 1px solid #cccccc;\"><a href=\"http://www.allfoodequip.com/used-equipment.php\" style=\"color: #cccccc; text-decoration: none;\">Used Equipment</a></li> <li style=\"padding: 0 10px; display: inline; border-right: 1px solid #cccccc;\"><a href=\"http://www.allfoodequip.com/services.php\" style=\"color: #cccccc; text-decoration: none;\">Services</a></li> <li style=\"padding: 0 10px; display: inline; border-right: 1px solid #cccccc;\"><a href=\"http://www.allfoodequip.com/about-us.php\" style=\"color: #cccccc; text-decoration: none;\">About Us</a></li> <li class=\"last\" style=\"padding:0 10px;display:inline;border-right:none;\"><a href=\"http://www.allfoodequip.com/contact-us.php\" style=\"color: #cccccc; text-decoration: none;\">Contact Us</a></li> </ul> <div class=\"margin_bottom_10\"></div><br> <span style=\"color:#FFF;\">Copyright © 2010 </span> - <a href=\"http://www.allfoodequip.com\"><font color=\"#FFFFCC\">All Food Equipment</font></a> <div class=\"margin_bottom_10\"></div> <!-- end of footer --> </div> <!--container--> </div> </body> </html> "; // MAIL SUBJECT $subject = "Your All Food Equip Quote"; // TO MAIL ADDRESS $to="$email"; mail($to, $subject, $msg, $headers); // Redirect header("Location: Admin.php?Msg=Sent"); ?> Heres the HTML side of it. <label for="img1">Image 1:</label> <input type="hidden" name="MAX_FILE_SIZE" value="2500000"> <input type="file" name="img1"> <label for="img2">Image 2:</label> <input type="hidden" name="MAX_FILE_SIZE" value="2500000"> <input type="file" name="img2"> <label for="img3">Image 3:</label> <input type="hidden" name="MAX_FILE_SIZE" value="2500000"> <input type="file" name="img3"> <label for="img4">Image 4:</label> <input type="hidden" name="MAX_FILE_SIZE" value="2500000"> <input type="file" name="img4"> <label for="img5">Image 5:</label> <input type="hidden" name="MAX_FILE_SIZE" value="2500000"> <input type="file" name="img5"><br /> Thanks in advance.
-
Looking to create a shopping cart, Any good tutorials....
laflair13 replied to laflair13's topic in Miscellaneous
Basically I want to add products and have them all on a single page in a list, with side images. Then when they click on the link or image it goes to the product page and I want it to be able to put the image on the page with details and then a Get Quote button that leads to email submit. (O yea, I would love to have an admin section that I can just plug in details and it creates the listing.) Kinda like the 2 images I provided below. 1st page - List of products 2nd page - Product details Is there any tutorial to show me how to do this or maybe an already pre-made script that I can plug into my website? -
Looking to create a shopping cart, Any good tutorials....
laflair13 replied to laflair13's topic in Miscellaneous
I need something from the very beginning, Like setting up the database, creating the admin side (where I can add, delete, and modify) products. -
Basically I am trying to crate a shopping cart similar to http://www.sigmapackaging.com/equipment/detail/7721 Is there any good tutorials for a beginner to do this? I have really good knowledge of html and css, but I am a beginner when it comes to php. I can edit it, just dont know how to code it from scratch. Any help would be appreciated.
-
Your exactly right, I want it to pull the data from the database and put it in the url. So it will look like domain.com/stream/Here-is-the-title I have been reading up on it and in order to have it say stream, I would have to rename the pop.php to stream.php
-
I appreciate it. But I want the domain.com/pop.php?play to become domain.com/play/shows-title
-
Hey all, Not sure if this is the right section, So I apologize if not and please move to correct area. Ok, my question is, I have a site where I can add stuff quick through the admin. But it gives is a numeric url. And example mydomain.com/pop.php?Play=179 But I want it to say something like mydomain.com/here-is-a-seo-page Is there any way to do this, and if so can you point me in the right direction so I can learn it and put it on my site. Thanks in advance.
-
Marked it solved. Again, I appreciate everyones help on this. Just needed to make some minor adjustments.