Jump to content

cdoggg94

Members
  • Posts

    158
  • Joined

  • Last visited

Everything posted by cdoggg94

  1. I wish I could tell you what the error says, but dreamweaver only says syntax error and when I test in a browser with error_reporting(-1) there is this error of the page: "HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request."
  2. Attached is an image of a pages content. It shows all products that a specific client has ordered. I have got this by making a recordset in dreamweaver named "AllWine" Then for all of them to show I have used the "Repeat Region" server behavior in dreamweaver. in the back ground of this page it also emails the information to people so they can view it. my problem is that I can only display the first product and its information.. When I write the repeat region information in the code it just says sintax error. this is the code (without the repeating region): <?php //-------------email section----------------// $productName = $row_AllWine['wish_client']; $unitPrice = "$".number_format(($row_AllWine['wish_bottle'])/($row_AllWine['wish_case']), 2); $proQty = $row_AllWine['wish_case']; $customer = $row_AllWine['wish_product']; $grandTotal = $_GET['Total']; $unitTotal = $row_AllWine['wish_bottle']; $thisClient = $_GET['FinOrder']; $to = "email@gmail.com"; $subject = "New Order"; $message = " <html> <head> <title>New Order</title> </head> <body> <div align='center'> <img src='http://website.com/images/header.jpg' /> <br /> Client Name: ".$thisClient."<br /><br /> <table border='0' width='500'> <tr> <th width='125' align='left'>Product</th> <th width='125' align='center'>Unit Price</th> <th width='125' align='center'>Qty</th> <th width='125' align='right'>Total</th> </tr> <tr> <td align='left'>".$productName."</td> <td align='center'>".$unitPrice."</td> <td align='center'>".$proQty."</td> <td align='right'>$".number_format($unitTotal, 2)."</td> </tr> <tr> <td colspan='4' align='right'>Grand Total = ".$grandTotal."</td> </tr> </table> </div> </body> </html> "; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $headers .= 'From: <email@hotmail.com>'. "\r\n"; mail($to,$subject,$message,$headers); ?> and i thought that something like this would repeat the information and show all of the records for that person in the email. Im just not sure which part is causing the sintax error <?php //-------------email section----------------// $productName = $row_AllWine['wish_client']; $unitPrice = "$".number_format(($row_AllWine['wish_bottle'])/($row_AllWine['wish_case']), 2); $proQty = $row_AllWine['wish_case']; $customer = $row_AllWine['wish_product']; $grandTotal = $_GET['Total']; $unitTotal = $row_AllWine['wish_bottle']; $thisClient = $_GET['FinOrder']; $to = "email@gmail.com"; $subject = "New Order"; $message = " <html> <head> <title>New Order</title> </head> <body> <div align='center'> <img src='http://website.com/images/header.jpg' /> <br /> Client Name: ".$thisClient."<br /><br /> <table border='0' width='500'> <tr> <th width='125' align='left'>Product</th> <th width='125' align='center'>Unit Price</th> <th width='125' align='center'>Qty</th> <th width='125' align='right'>Total</th> </tr> ".do {." //this is the start of the repeat region <tr> <td align='left'>".$productName."</td> <td align='center'>".$unitPrice."</td> <td align='center'>".$proQty."</td> <td align='right'>$".number_format($unitTotal, 2)."</td> </tr> ".} while ($row_AllWine = mysql_fetch_assoc($AllWine));." //this is the end of the repeat region. <tr> <td colspan='4' align='right'>Grand Total = ".$grandTotal."</td> </tr> </table> </div> </body> </html> "; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $headers .= 'From: <email@hotmail.com>'. "\r\n"; mail($to,$subject,$message,$headers); ?> its probably something right in front of me but i cant seem to see it. if anyone has any ideas it would be great thanks!
  3. I think with the additions you 2 have made to my script it is working the way it should be ! Many thanks ! I appreciate it very much !
  4. I do not get an error... Basically it it left blank. I will try the to assign it as you have stated and get back to you. Sorry i was away for an hour. I will respond very soon!
  5. <?php $link = mysql_connect('localhost', 'user', 'pw'); if (!$link) { die('Could not connect: ' . mysql_error()); } if (!mysql_select_db('my_DB')) { die('Could not select database: ' . mysql_error()); } $query = mysql_query("SELECT SUM(wish_total) FROM wish_list WHERE wish_product= '30108'"); if (!$query) { die('Could not query:' . mysql_error()); } echo mysql_result($query); ?> in the code above i am trying to add up the wish_total column in my table wish_list. When i ran this query in phpmyadmin, it added it up fine. Im not sure if i am echoing the correct thing, because i think that the query is working. suggestions ?
  6. Thank you! But where is this content displayed? Or how to i display the calculation.. Like I can't just do this: <?php echo mysql_query("SELECT SUM(wish_total) FROM wish_list WHERE wish_date = '" . $mymessage . "' AND wish_product = " . $totalnum);?> Nothing comes up..So how can it be displayed ?
  7. So I want to add up all of the entries in my "wish_total" column, that is inside my "wish_list" table. ...I also only want it to add them up if the date and another number is correct... my query goes like this: <?php $totalnum = $_GET['Details']; $totalinfo = mysql_query("SELECT wish_total FROM wish_list WHERE wish_date='".$mymessage."' AND wish_product=".$totalnum." COMPUTE SUM(SIZE)"); ?> I got this example from here: http://stackoverflow.com/questions/2628159/sql-add-up-all-row-values-of-one-column-in-a-singletable I dont really know if it is working or not because i don't know how to display the results. I have just tried to echo $totalinfo, but nothing really came out. Advice would be fantastic!
  8. i musthave done something really weird haha
  9. Attached is an example that might make more sense then what I have written
  10. So this is the code for my form. It is a table that shows all records in a table on my database. my plan is to have an add button at the right most column so they can add a number into the Qty text box and press add. When you press add i want it to insert as a new entry in my db with the information below. <div id="newListForm"> <?php $mydate = getDate(); $thismonth = $mydate['month']; $thisday = $mydate['mday']; $thisyear = $mydate['year']; $thisTime = date('H:i:s'); $mymessage = $thismonth." ".$thisday.", ".$thisyear; ?> <form action="<?php echo $editFormAction; ?>" id="form" name="form" method="POST"> <table border="0"> <tr align="center"> <th width="60" align="left">LCBO #</th> <th width="250" align="left">Product</th> <th width="40">Size</th> <th width="50">Btl/cs</th> <th width="54">LTO</th> <th width="79">Price</th> <th width="103">Qty</th> <th width="91"> </th> </tr> <?php do { ?> <tr> <td><?php echo $row_AllWine['lcbo_num'] ;?></td> <td><?php echo $row_AllWine['pro_name'] ;?></td> <td align="center"><?php echo $row_AllWine['pro_size'] ;?></td> <td align="center"><?php echo $row_AllWine['pro_btl'] ;?></td> <td align="center"> <span class="LTOlist"> <?php if($row_AllWine['F7']=="LTO"){ echo "LTO"; }else{ echo ""; } ?> </span> </td> <td align="center"><?php echo $row_AllWine['pro_price'] ;?></td> <td align="center"><input name="qty" type="text" size="10" /></td> <td align="right"> <input type="hidden" name="date" id="date" value="<?php echo $mymessage ;?>" /> <input type="hidden" name="product" id="product" value="<?php echo $row_AllWine['pro_name'] ;?>" /> <input type="hidden" name="client" id="client" value="<?php echo $detnum ;?>" /> <input type="hidden" name="id" id="id" value="" /> <input type="hidden" name="normal" id="normal" value="<?php echo $row_AllWine['pro_price'] ;?>" /> <input type="hidden" name="normalCase" id="normalCase" value="<?php echo "" ;?>" /> <input type="hidden" name="LTO" id="LTO" value="<?php echo "" ;?>" /> <input type="hidden" name="LTOCase" id="LTOCase" value="<?php echo "" ;?>" /> <input name="submit" type="submit" value="Add" /></td> </tr> <?php } while ($row_AllWine = mysql_fetch_assoc($AllWine)); ?> <tr> <td colspan="8" align="right"> </td> </tr> </table> <input type="hidden" name="MM_insert" value="form" /> </form> </div> below here is the dream weaver created code for inserting that i am trying to use. <?php $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form")) { $insertSQL = sprintf("INSERT INTO wish_list (wish_id, wish_client, wish_product, wish_bottle, wish_case, wish_bottle_LTO, wish_caseLTO, wish_total, wish_date) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($_POST['id'], "int"), GetSQLValueString($_POST['product'], "text"), GetSQLValueString($_POST['client'], "text"), GetSQLValueString($_POST['normal']*$_POST['qty'], "text"), GetSQLValueString($_POST['normalCase'], "text"), GetSQLValueString($_POST['LTO'], "text"), GetSQLValueString($_POST['LTOCase'], "text"), GetSQLValueString($_POST['normal']*$_POST['qty'], "text"), GetSQLValueString($_POST['date'], "text")); mysql_select_db($database_myConnect, $myConnect); $Result1 = mysql_query($insertSQL, $myConnect) or die(mysql_error()); $insertGoTo = "NewOrder.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } ?> basically i think that its not working because of how my form is set up... when i echo out the values for the hidden fields it does show content. it just doesnt want to insert them into the DB.. does anyone have any advice? or see something that I am obviously over looking ?
  11. Turned out that it works if the $link variable doesn't have the "<a href...etc." in it and only the $_POST information then it works fine...
  12. is there a reason that it would show the percentage uploading in the bottom of the broswer if it doesn'y actually upload it ?
  13. Nothing comes up when turned to (-1) I just get the error I have put in saying "Problem Uploading Image" ..reading my last post I left out the part that I'm sure is causing the issue... this part: if(!$insert = mysql_query ("INSERT INTO LTO_tbl VALUES ('','".$image_name."','".$image."','".$title."','".$info."','".$myheight."','".$mywidth."','".$period."','".$link."')")) echo "Problem Uploading Image."; I have echoed information up until that point and everything worked till right there
  14. So I have gotten this exact same thing to work many times... today it does not want to upload... I have narrowed it down to the part but everything seems to be correct...I have looked over it several times and cant seem to find out what is going on.. here is the full upload code: <?php error_reporting(0); mysql_connect("localhost","root","") or die(mysql_error()); mysql_select_db("my_db") or die(mysql_error()); $picture = $_FILES['image']['tmp_name']; $title = $_POST['title']; $info = $_POST['info']; $period = $_POST['period']; //echo $period; $link = "<a href='http://www.MYSITE.com/Agency/product3.php?Product=".$_POST['proNumber']."' target='_blank'>Details</a>"; if(!isset($picture)) echo ""; else { $image = addslashes(file_get_contents($_FILES['image']['tmp_name'])); $image_name = addslashes($_FILES['image']['name']); $image_size = getimagesize($_FILES['image']['tmp_name']); $max_width = 250; $max_height = 377; list($width, $height) = $image_size; //echo $width.",".$height; $ratioh = $max_height/$height; $ratiow = $max_width/$width; $ratio = min($ratioh, $ratiow); // New dimensions $mywidth = intval($ratio*$width); $myheight = intval($ratio*$height); //echo $mywidth." x ".$myheight ; if($image_size==FALSE) echo "No image was seleted"; else{ if(!$insert = mysql_query ("INSERT INTO LTO_tbl VALUES ('','".$image_name."','".$image."','".$title."','".$info."','".$myheight."','".$mywidth."','".$period."','".$link."')")) echo "Problem Uploading Image."; else{ $lastid = mysql_insert_id(); //$lastid = "23"; echo "LTO added!<p /> This is what will appear on your page:<p /> <table border='0'> <tr> <td valign='top'><img src='get_3.php?Product=$lastid' height='".$myheight."' width='".$mywidth."' ></td> <td valign='top'> Title: ".$title." <p> LTO Info: ".$info."</p> <p> Link: ".$link."</p> <p> Period: ".$period."</p> </td> </tr> </table> "; } } } ?> and this would be the form : <form action="newLTO.php" method="post" enctype="multipart/form-data"> <table width="600" border="0" > <tr> <td align="right">Image:</td> <td><input style="background-color:#000" type="file" name="image"></td> </tr> <tr> <td align="right">Title:</td> <td><input style="background-color:#000; color:#FFF;" name="title" type="text"/></td> </tr> <tr> <td align="right">LTO Info:</td> <td><textarea name="info" cols="40" rows="10" style="background-color:#000; color:#FFF;"></textarea></td> </tr> <tr> <tr> <td align="right">Product Number:</td> <td><input name="proNumber" type="text" style="background-color:#000; color:#FFF;" /></td> </tr> <tr> <td align="right">Period:</td> <td><input name="period" type="text" style="background-color:#000; color:#FFF;" /></td> </tr> <tr> <td align="right"></td> <td><input INPUT TYPE="image" SRC="images/images/addLTO.jpg" HEIGHT="31" WIDTH="50" BORDER="0" ALT="Submit Form" /> </td> </tr> </table> </form> i have attached an image on the DB Im not asking someone to do it for me but if anyone could maybe give me some advice as to what im doing wrong it would be greatly appreciated..
  15. I wish i would have seen jcbones post a while ago...but yea that works perfectly
  16. Well i have figured it out... <form id="form1" name="form1" method="get" action="results.php"> <label> </label> <table border="0"> <tr> <td> <div align="center"> <input type="hidden" name="Details" id="Details" value="<?php echo $detnum ;?>" /> <br /> <input name="findthis" type="text" id="findthis" size="15" /> <input type="submit" name="submit" id="submit" value="Search" /> </div></td> </tr> </table> </form> i took all the JS out. I think someone had said something about a hidden field and I went that way and it seems to work exactly how i want it to
  17. I think that you are right though.. something like this should work : <form class="search" method="get" action="search.php?details=<? echo $detnum;?>&Search"> <input type="text" name="Search" size="50" /> <a href="document.getElementById('search').submit('search')">Search</a> </form> the only problem is that it doesnt use that as a link...i just looked up something and it wanted me to make a JS function and then give the <a id=""> the element from the function like this: <script type="text/javascript"> function changeLink() { document.getElementById('MyLink').innerHTML="Bookmark me!"; document.getElementById('MyLink').href="javascript:document.write('<html><head><title>{$txt_short_url}</title></head><body><form name=\'urlform\' action=\'{$short_url}\' method=\'post\'><input type=\'hidden\' name=\'u\' value=\'' + window.location.href + '\' /></form></body></html>');document.forms[0].submit()"; document.getElementById('MyLink').target="_blank"; } </script> <body onload changeLink();> <a id="MyLink" href="http://www.JustaLink.com">Just A Link</a> does that seem correct ? is so i can probably edit it to work for me...
  18. I am going to try that new code right now.... The details thing retrieves a clients information from a different table on the data base that I need to display, and when I'm done on the search page they would press back and I want to send back to the original page they were on... Thanks again for your help
  19. my results looks like this from the form above... <?php $mysearch = $_GET['findthis']; //echo $mysearch; mysql_select_db($database_TrendConnect); $q = "SELECT * FROM Sheet1 WHERE pro_name LIKE '%" . mysql_real_escape_string($mysearch) . "%' OR lcbo_num LIKE '%" . mysql_real_escape_string($mysearch) . "%' ORDER BY pro_name ASC"; $mystuff = mysql_query($q); $num_rows = mysql_num_rows($mystuff); if($num_rows >= 1){ echo "<span class='Graphtitle'>There were ".$num_rows." results for your search!</span><br /><br />"; while($row = mysql_fetch_assoc($mystuff)) { echo "<table border='0'><tr><td>";?><a href="#" onClick="MyWindow=window.open('<?php echo "http://www.MYSITE.com/Agency/product3.php?Product=".$row['pro_id']; ?>','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=800,height=886'); return false;"><?php echo $row['pro_name']."</a> <span class='LTOlist'>".$row['F7']."</span><br /></td></tr></table>"; } } if($num_rows == 0){ echo "<span class='Graphtitle'>There were no results for your search</span>"; } ?> $findthis would be "$search" on your example...i dont know how or where to add the "details" part in it when i need it in the URL of this page...sorry if thats a really dumb thing to say...im a little confused
  20. im probably doing it wrong haha..its been a long day... i am going to try again in the morning... i will let u know though! thanks again for the help ! much appreciated
  21. i have modified it to fit my code and doesnt seem to want to use the correct link..but thank you !
  22. I am trying to get a search form's action to be a link that goes like this: MYSITE.com/cTrends/Agent/results.php?Details=78&findthis=jackson&submit=Search this is my form: <form id="form1" name="form1" method="get" action="results.php?Details=<?php echo $detnum ;?>"> //$detnum in this case is = 78.. <label> </label> <table border="0"> <tr> <td> <div align="center"><br /> <input name="findthis" type="text" id="findthis" size="15" /> <input type="submit" name="submit" id="submit" value="Search" /> </div></td> </tr> </table> </form> my problem is that the "?Details=78" will not display... any ideas why ? did I just do it wrong? or is it no possible? im a little confused because when i press submit, the search works fine and if i manually type in the Details part it works too, but it wont print it when I hit submit..
  23. Well I have this: <?php //require_once("Connections/jodysConnect.php"); $mysearch = $_GET['findthis']; //echo $mysearch; mysql_select_db($database_TrendConnect); $q = "SELECT * FROM Sheet1 WHERE pro_name LIKE '%" . mysql_real_escape_string($mysearch) . "%' OR lcbo_num LIKE '%" . mysql_real_escape_string($mysearch) . "%' ORDER BY pro_name ASC"; $mystuff = mysql_query($q); $num_rows = mysql_num_rows($mystuff); if($num_rows >= 1){ echo "<span class='Graphtitle'>There were ".$num_rows." results for your search!</span><br /><br />"; while($row = mysql_fetch_assoc($mystuff)) { echo "<table border='0'><tr><td>";?><a href="#" onClick="MyWindow=window.open('<?php echo "http://www.THISWEBSITE.com/Agency/product3.php?Product=".$row['pro_id']; ? >','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width= 800,height=886'); return false;"><?php echo $row['pro_name']."</a><br /></td></tr></table>"; } } if($num_rows == 0){ echo "<span class='Graphtitle'>There were no results for your search</span>"; } ?> It seems to be working. I don't know if its done in the best way possible, but it does seem to be doing what I want it to do. Thanks anyways for the help Cheers
  24. hopefully that explains it... again sorry..
×
×
  • 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.