Jump to content

JLitkie

Members
  • Posts

    43
  • Joined

  • Last visited

Everything posted by JLitkie

  1. Hello I created a form where the table to enter into uses calls from a database for the questions, but the generated fields are not called they are created with a foreach. The form calls just fine, however when I go to the page to process and update the table, it does not seem to want to insert the answers on an update. I have tried variable combinations and tried to research the problem to no avail. HELP!!! form coding $result = mysql_query("SELECT * FROM interviews WHERE id='$int'"); while($row = mysql_fetch_array($result)){ $a = $row[1]; $b = $row[2]; $c = $row[3]; $d = $row[4]; $e = $row[5]; $f = $row[7]; $g = $row[8]; $h = $row[9]; } $i = array(); $result = mysql_query("SELECT * FROM dbinter WHERE interview_id='$int'"); while($row = mysql_fetch_array($result)){ $i[] = $row[2]; } $l = array(); $result = mysql_query("SELECT * FROM form_custom WHERE attached='$cid' && date='$e'"); while($row = mysql_fetch_array($result)){ $l[] = $row[0]; } echo "<font style='font-size: 45px;'>$a $b</font>"; echo "<p><font style='font-size: 20px;'>$c <br />$d</font></p>"; echo "<form method='POST' name='interview' action='interviewsheet.php?cid=$cid&int=$int&stat=proc'>"; echo "<div style='margin-top:50px;'><input type='submit' value='COMPLETE INTERVIEW'></div>"; foreach($i as $j){ $result = mysql_query("SELECT * FROM form WHERE id='$j'"); while($row = mysql_fetch_array($result)){ $k = $row[2]; } echo " <div style='margin: 20px;'> <font styler='font-size: large; font-weight: bold;'>$k</font><br /> <textarea rows='5' cols='60' style='border: none;' name='q'></textarea> </div> ";} foreach($l as $m){ $result = mysql_query("SELECT * FROM form_custom WHERE id='$m'"); while($row = mysql_fetch_array($result)){ $n = $row[2]; } echo " <div style='margin: 20px;'> <font styler='font-size: large; font-weight: bold;'>$n</font><br /> <textarea rows='5' cols='60' style='border: none;' name='qc'></textarea> </div> ";} echo "</div>"; Here is the processing page code: $act = $_GET['act']; $cid = $_GET['cid']; $int = $_GET['int']; $stat = $_GET['stat']; $sub = $_GET['sub']; if($stat == "proc"){ $c = array(); $c[] = $_POST['q']; foreach($c as $b => $d){ $sql = "UPDATE dbinter SET answer='$d' WHERE interview_id='$int'"; if (!mysql_query($sql,$con)){die('Error: ' . mysql_error());} } $f = array(); $f[] = $_POST['q']; foreach($f as $g => $f){ $sql = "UPDATE dbinter SET answer='$f' WHERE attached='$cid'"; if (!mysql_query($sql,$con)){die('Error: ' . mysql_error());} }
  2. Hi, Im trying to call from a database and have it put it in a set of divs and paragraphs. After three sets it puts in a set of code and repeats the previous divs sets but with continued information called from the database. A copy of the code ii have and the original code is below. current code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="dcterms.created" content="Tue, 13 Nov 2012 21:07:39 GMT"> <meta name="description" content=""> <meta name="keywords" content=""> <title></title> <!--[if IE]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <?php include 'db_connect.php'; mysql_select_db("xxxxxxxxxxxxx", $con); $result = mysql_query("SELECT * FROM image_info"); $i = 0; while($row = mysql_fetch_array($result)) { $i++; $additionalClass = ($i % 3) == 0 ? " last" : ""; echo "<div class='photo m_bot1" . $additionalClass . "'>"; echo "<div class='photo m_bot1'> <p> <a href='#' class='img_wrap'><img src='$row[3]' width='286' height='268' alt='photo1' /></a> </p> <a href='#'><span class='white'>$row[2]</span><br> $row[1]</a> </div>"; } ?> </body> </html> old code: <!DOCTYPE html> <html lang="en"> <head> <title>Photos</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width; initial-scale=1.0"> <link rel="icon" href="images/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" /> <link rel="stylesheet" type="text/css" media="screen" href="css/style.css"> <script type="text/javascript" src="js/jquery-1.7.min.js"></script> <script type="text/javascript" src="js/superfish.js"></script> <script type="text/javascript" src="js/jquery.responsivemenu.js"></script> <script type="text/javascript" src="js/jquery.easing.1.3.js"></script> <script type="text/javascript" src="js/jquery.elastislide.js"></script> <!--[if lt IE 8]> <div style=' clear: both; text-align:center; position: relative;'> <a href="http://windows.microsoft.com/en-US/internet-explorer/products/ie/home?ocid=ie6_countdown_bannercode"> <img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg" border="0" height="42" width="820" alt="You are using an outdated browser. For a faster, safer browsing experience, upgrade for free today." /> </a> </div> <![endif]--> <!--[if lt IE 9]> <script type="text/javascript" src="js/html5.js"></script> <link rel="stylesheet" type="text/css" media="screen" href="css/ie.css"> <![endif]--> </head> <body> <div class="main"> <nav> <div class="container_12"> <ul class="sf-menu"> <li class="sf-with-ul"><a href="index.html">home</a> <ul> <li><a href="#">Annual Passes</a></li> <li><a href="#">Oceans Society</a></li> <li><a href="#">Sponsors</a> <ul> <li><a href="#">Aquarium Events</a></li> <li><a href="#">Neon Tetras</a></li> <li><a href="#">Mollies</a></li> <li class="bd_none"><a href="#">Species</a></li> </ul> </li> <li class="bd_none"><a href="#">Swordtails</a></li> </ul> </li> <li><a href="index-1.html">about</a></li> <li class="current"><a href="index-2.html">photos</a></li> <li><a href="index-3.html">club info</a></li> <li><a href="index-4.html">fish</a></li> <li><a href="index-5.html">contact us</a></li> </ul> <form id="search" action="search.php" method="GET" accept-charset="utf-8"> <input type="text" name="s" /> <a onclick="document.getElementById('search').submit()"></a> </form> <div class="clear"></div> </div> </nav> <!--==============================header=================================--> <header> <div class="container_12"> <h1><a class="logo" href="index.html">Aquamarine</a></h1> <div class="social"> <a href="#" title="Facebook"><img src="images/soc1.png" width="23" height="46" alt=""></a> <a href="#" title="RSS"><img src="images/soc2.png" width="23" height="46" alt=""></a> <a href="#" title="Google +"><img src="images/soc3.png" width="23" height="46" alt=""></a> <a href="#" title="Twitter"><img src="images/soc4.png" width="23" height="46" alt=""></a> </div> <div class="clear"></div> </div> </header> <!--==============================content================================--> <section id="content"> <div class="container_12"> <div class="wrapper"> <article class="grid_12"> <h2 class="ind2">Our photos</h2> <div class="car_box"> <div id="carousel" class="es-carousel-wrapper"> <div class="es-carousel"> <ul> <li class="first_it"> <div class="photo m_bot1"> <p> <a href="#" class="img_wrap"><img src="images/photo1.jpg" width="286" height="268" alt="photo1" /></a> </p> <a href="#"><span class="white">Sed ut perspiciatis</span><br> Donec vestibulum, eros sed adipiscing aliquet, magna mauris ultrices mi, in vestibulum ligula dolor eu nibhsi. Ut sollicitudin lectus nec libero porta dignissim.</a> </div> <div class="photo m_bot1"> <p> <a href="#" class="img_wrap"><img src="images/photo4.jpg" width="286" height="268" alt="photo1" /></a> </p> <a href="#"><span class="white">Aliquam erat volutpat</span><br> Donec vestibulum, eros sed adipiscing aliquet, magna mauris ultrices mi, in vestibulum ligula dolor eu nibhsi. Ut sollicitudin lectus nec libero porta dignissim.</a> </div> <div class="photo"> <p> <a href="#" class="img_wrap"><img src="images/photo7.jpg" width="286" height="268" alt="photo1" /></a> </p> <a href="#"><span class="white">Duis ultricies</span><br> Donec vestibulum, eros sed adipiscing aliquet, magna mauris ultrices mi, in vestibulum ligula dolor eu nibhsi. Ut sollicitudin lectus nec libero porta dignissim.</a> </div> </li> <li class="first_it"> <div class="photo m_bot1"> <p> <a href="#" class="img_wrap"><img src="images/photo2.jpg" width="286" height="268" alt="photo1" /></a> </p> <a href="#"><span class="white">Mauris accumsan nulla</span><br> Donec vestibulum, eros sed adipiscing aliquet, magna mauris ultrices mi, in vestibulum ligula dolor eu nibhsi. Ut sollicitudin lectus nec libero porta dignissim.</a> </div> <div class="photo m_bot1"> <p> <a href="#" class="img_wrap"><img src="images/photo5.jpg" width="286" height="268" alt="photo1" /></a> </p> <a href="#"><span class="white">Integer rutrum</span><br> Donec vestibulum, eros sed adipiscing aliquet, magna mauris ultrices mi, in vestibulum ligula dolor eu nibhsi. Ut sollicitudin lectus nec libero porta dignissim.</a> </div> <div class="photo m_bot1"> <p> <a href="#" class="img_wrap"><img src="images/photo8.jpg" width="286" height="268" alt="photo1" /></a> </p> <a href="#"><span class="white">Maecenas tristique</span><br> Donec vestibulum, eros sed adipiscing aliquet, magna mauris ultrices mi, in vestibulum ligula dolor eu nibhsi. Ut sollicitudin lectus nec libero porta dignissim.</a> </div> </li> <li class="first_it"> <div class="photo m_bot1"> <p> <a href="#" class="img_wrap"><img src="images/photo3.jpg" width="286" height="268" alt="photo1" /></a> </p> <a href="#"><span class="white">Nulla facilisi</span><br> Donec vestibulum, eros sed adipiscing aliquet, magna mauris ultrices mi, in vestibulum ligula dolor eu nibhsi. Ut sollicitudin lectus nec libero porta dignissim.</a> </div> <div class="photo m_bot1"> <p> <a href="#" class="img_wrap"><img src="images/photo6.jpg" width="286" height="268" alt="photo1" /></a> </p> <a href="#"><span class="white">Nam elit magna, hendrerit</span><br> Donec vestibulum, eros sed adipiscing aliquet, magna mauris ultrices mi, in vestibulum ligula dolor eu nibhsi. Ut sollicitudin lectus nec libero porta dignissim.</a> </div> <div class="photo m_bot1"> <p> <a href="#" class="img_wrap"><img src="images/photo9.jpg" width="286" height="268" alt="photo1" /></a> </p> <a href="#"><span class="white">Donec accumsan malesuada </span><br> Donec vestibulum, eros sed adipiscing aliquet, magna mauris ultrices mi, in vestibulum ligula dolor eu nibhsi. Ut sollicitudin lectus nec libero porta dignissim.</a> </div> </li> <li class="first_it"> <div class="photo m_bot1"> <p> <a href="#" class="img_wrap"><img src="images/photo1.jpg" width="286" height="268" alt="photo1" /></a> </p> <a href="#"><span class="white">Sed ut perspiciatis</span><br> Donec vestibulum, eros sed adipiscing aliquet, magna mauris ultrices mi, in vestibulum ligula dolor eu nibhsi. Ut sollicitudin lectus nec libero porta dignissim.</a> </div> <div class="photo m_bot1"> <p> <a href="#" class="img_wrap"><img src="images/photo4.jpg" width="286" height="268" alt="photo1" /></a> </p> <a href="#"><span class="white">Aliquam erat volutpat</span><br> Donec vestibulum, eros sed adipiscing aliquet, magna mauris ultrices mi, in vestibulum ligula dolor eu nibhsi. Ut sollicitudin lectus nec libero porta dignissim.</a> </div> <div class="photo"> <p> <a href="#" class="img_wrap"><img src="images/photo7.jpg" width="286" height="268" alt="photo1" /></a> </p> <a href="#"><span class="white">Duis ultricies</span><br> Donec vestibulum, eros sed adipiscing aliquet, magna mauris ultrices mi, in vestibulum ligula dolor eu nibhsi. Ut sollicitudin lectus nec libero porta dignissim.</a> </div> </li> <li class="first_it"> <div class="photo m_bot1"> <p> <a href="#" class="img_wrap"><img src="images/photo2.jpg" width="286" height="268" alt="photo1" /></a> </p> <a href="#"><span class="white">Mauris accumsan nulla</span><br> Donec vestibulum, eros sed adipiscing aliquet, magna mauris ultrices mi, in vestibulum ligula dolor eu nibhsi. Ut sollicitudin lectus nec libero porta dignissim.</a> </div> <div class="photo m_bot1"> <p> <a href="#" class="img_wrap"><img src="images/photo5.jpg" width="286" height="268" alt="photo1" /></a> </p> <a href="#"><span class="white">Integer rutrum</span><br> Donec vestibulum, eros sed adipiscing aliquet, magna mauris ultrices mi, in vestibulum ligula dolor eu nibhsi. Ut sollicitudin lectus nec libero porta dignissim.</a> </div> <div class="photo m_bot1"> <p> <a href="#" class="img_wrap"><img src="images/photo8.jpg" width="286" height="268" alt="photo1" /></a> </p> <a href="#"><span class="white">Maecenas tristique</span><br> Donec vestibulum, eros sed adipiscing aliquet, magna mauris ultrices mi, in vestibulum ligula dolor eu nibhsi. Ut sollicitudin lectus nec libero porta dignissim.</a> </div> </li> <li class="first_it"> <div class="photo m_bot1"> <p> <a href="#" class="img_wrap"><img src="images/photo3.jpg" width="286" height="268" alt="photo1" /></a> </p> <a href="#"><span class="white">Nulla facilisi</span><br> Donec vestibulum, eros sed adipiscing aliquet, magna mauris ultrices mi, in vestibulum ligula dolor eu nibhsi. Ut sollicitudin lectus nec libero porta dignissim.</a> </div> <div class="photo m_bot1"> <p> <a href="#" class="img_wrap"><img src="images/photo6.jpg" width="286" height="268" alt="photo1" /></a> </p> <a href="#"><span class="white">Nam elit magna, hendrerit</span><br> Donec vestibulum, eros sed adipiscing aliquet, magna mauris ultrices mi, in vestibulum ligula dolor eu nibhsi. Ut sollicitudin lectus nec libero porta dignissim.</a> </div> <div class="photo m_bot1"> <p> <a href="#" class="img_wrap"><img src="images/photo9.jpg" width="286" height="268" alt="photo1" /></a> </p> <a href="#"><span class="white">Donec accumsan malesuada </span><br> Donec vestibulum, eros sed adipiscing aliquet, magna mauris ultrices mi, in vestibulum ligula dolor eu nibhsi. Ut sollicitudin lectus nec libero porta dignissim.</a> </div> </li> </ul> </div> </div> </div> </article> </div> </div> </section> <!--==============================footer=================================--> <footer> Aquamarine © 2012 | <a href="index-6.html">Privacy Policy</a> </footer> </div> </body> </html>
  3. sorry forgot parent script and <SCRIPT LANGUAGE="JavaScript"> function openChild(file,window) { childWindow=open(file,window,'resizable=yes,scrollbars=yes,width=500,height=600'); if (childWindow.opener == null) childWindow.opener = self; } </SCRIPT> </head> <body> <form method="POST" action="proc3.php" name="catering"> <table cellpadding=5 border=0 width=80% align=left> <tr> <td><b>Name</b></td> <td><input type=text name="name" size=50 class="form"></td> </tr> <tr> <td><b>Phone</b></td> <td><input type=text name="phone" size=25 class="form"></td> </tr> <tr> <td><b>Email</b></td> <td><input type=text name="email" size=50 class="form"></td> </tr> <tr> <td colspan=2 valign=top><b>Catering Request Description <INPUT TYPE="button" VALUE="(MENU)" onmouseover="" onClick="openChild('menusub.php','win2')" class="menusubhead"></td></tr> <tr> <tr> <td></td> <td> <input type=hidden name="subject" value="Catering Service" size=50 class="form"> <textarea name="details" id="details" cols="50" Rows="12" style="font-size:15px; border:solid; font-family:Bradley Hand ITC, Book Antiqua, Arial; border:solid 1px; background-color:transparent;"></textarea></td> </tr> <tr> <td></td> <td><input type=submit class="submit" value="Send Message" style=""></td> </tr> </table> </form> child window <SCRIPT LANGUAGE="JavaScript"> var myarray_child = new Array (); function updateParentArray() { opener.document.catering.details.value = (myarray_child); } </SCRIPT> </head> <body> include("database.php"); mysql_select_db("db369261593", $con); $result = mysql_query("SELECT * FROM menu WHERE category='Antipasti' AND status='current'"); while($row = mysql_fetch_array($result)) { echo"<tr><td> <SCRIPT LANGUAGE='JavaScript'> myarray_child='$row[1]' </SCRIPT> <INPUT TYPE='SUBMIT' value='$row[1]' class='menusubhead' onClick='updateParentArray()'> <font class='subhead'><b>$$row[4]</b></font><br></font> <font class='menutext'>$row[2]</font> </tr></td>"; } The child window has about 5 or six of the above code repeated for each section. I just put in the snippets, if you need more please let me know.
  4. I have been struggling to get this problem fixed. I am trying to click on a link in a child window and have it add information to a textbox in a parent window. I have gotten close through some Javascript, but its still not working correct. The main problem is that the information on the child window is pulled from a database and wont cooperate with the javascript. I appreciate any help I can get on this one, thanks ya'll.
  5. Hey guys I am very frustrated with this code. I'm trying to write it to where you have a textbox, you click on a link/button and a child window pops. When you click on something from the child window it adds it to the textbox on the parent form. I am using a mix of javascript and php because the items on the child window is pulled from a db. The script pieces are below. this is the java from the parent <SCRIPT LANGUAGE="JavaScript"> function openChild(file,window) { childWindow=open(file,window,'resizable=yes,scrollbars=yes,width=500,height=600'); if (childWindow.opener == null) childWindow.opener = self; } </SCRIPT> This is the form from the parent, im trying to paste it to the textbox named "details". I want to add to what ever they are typing and not replace it. <form method="POST" action="proc3.php" name="catering"> <table cellpadding=5 border=0 width=80% align=left> <tr> <td><b>Name</b></td> <td><input type=text name="name" size=50 class="form"></td> </tr> <tr> <td><b>Phone</b></td> <td><input type=text name="phone" size=25 class="form"></td> </tr> <tr> <td><b>Email</b></td> <td><input type=text name="email" size=50 class="form"></td> </tr> <tr> <td colspan=2 valign=top><b>Catering Request Description <INPUT TYPE="button" VALUE="(MENU)" onmouseover="" onClick="openChild('menusub.php','win2')" class="menusubhead"></td></tr> <tr> <tr> <td></td> <td> <input type=hidden name="subject" value="Catering Service" size=50 class="form"> <textarea name="details" id="details" cols="50" Rows="12" style="font-size:15px; border:solid; font-family:Bradley Hand ITC, Book Antiqua, Arial; border:solid 1px; background-color:transparent;"></textarea></td> </tr> <tr> <td></td> <td><input type=submit class="submit" value="Send Message" style=""></td> </tr> </table> </form> This is the script from the child window <SCRIPT LANGUAGE="JavaScript"> var myarray_child = new Array (); function updateParentArray() { opener.document.catering.details.value = (myarray_child); } </SCRIPT> This is the information being pulled from the db that should be placed in the textbox. When i click it, it does send it, however it over writes everything in the box and its only pulling up the last result from the table. There are five things pulled from this db and I can only get it work for one. $result = mysql_query("SELECT * FROM menu WHERE category='Antipasti' AND status='current'"); while($row = mysql_fetch_array($result)) { echo"<tr><td> <SCRIPT LANGUAGE='JavaScript'> myarray_child='$row[1]' </SCRIPT> <INPUT TYPE='SUBMIT' value='$row[1]' class='menusubhead' onClick='updateParentArray()'> <font class='subhead'><b>$$row[4]</b></font><br></font> <font class='menutext'>$row[2]</font> </tr></td>"; } I appreciate any help i can get!! I am very frustrated and I have been at this for two days!! I spent my entire day on looking through coding websites to get help and Im stilled coming up short. Thanks guys!
  6. Hey guys I am having a struggle with some coding. I have a page where you can open a popup window with a bunch of links on it. I want to be able to click a link and have the information obtained on the link write to a textbox on the parent window. The window needs to stay open so they can click on several links and add a bunch of information to the text box. My current coding for the child window is: while($row = mysql_fetch_array($result)) { echo"<tr><td><a href='#' class=''" ?> onclick="opener.document.forms["catering"].elements["details"].value = '<?php echo"$row[1]"; ?> '"> <?php echo"$row[1]</a> <font class='subhead'><b>$$row[4]</b></font><br></font> <font class='menutext'>$row[2]</font> </tr></td>"; } The coding for the parent window regarding the form is: <form method="POST" action="proc2.php" name="catering"> <table cellpadding=5 border=0 width=80% align=left> <tr> <td><b>Name</b></td> <td><input type=text name="name" size=50 class="form"></td> </tr> <tr> <td><b>Phone</b></td> <td><input type=text name="phone" size=25 class="form"></td> </tr> <tr> <td><b>Email</b></td> <td><input type=text name="email" size=50 class="form"></td> </tr> <tr> <td colspan=2 valign=top><b>Catering Request Description <a href="menusub.php" onclick="NewWindow(this.href,'name','500','500','yes');return false" class="menusub">(MENU)</a></b></td> </tr> <tr> <tr> <td></td> <td> <input type=hidden name="subject" value="Catering Service" size=50 class="form"> <textarea name="details" id="details" cols="50" Rows="12" style="font-size:15px; border:solid; font-family:Bradley Hand ITC, Book Antiqua, Arial; border:solid 1px; background-color:transparent;"></textarea></td> </tr> <tr> <td></td> <td><input type=submit class="submit" value="Send Message" style=""></td> </tr> </table> </form> I appreciate any help I can get!!
  7. I need to stop things from duplicating the insert of products into a table on refresh. Im stumped! This is the insert page that forwards to the display page. <?php session_start(); $UserID = session_id(); $SKU = $_POST['SKU']; $QTY = $_POST['QTY']; include("database.php"); mysql_select_db("brandysbeanies", $con); $result = mysql_query("SELECT * FROM Products WHERE SKU='$SKU'"); while($row = mysql_fetch_array($result)) { $Name = $row[1]; $Image1 = $row[4]; $Image2 = $row[17]; $Image3 = $row[18]; $Image4 = $row[19]; $Description = $row[3]; $Cost = $row[5]; $Price = $row[6]; $Ship = $row[9]; $Option1 = $row[10]; $Option2 = $row[11]; $Option3 = $row[12]; $Option4 = $row[13]; $Option5 = $row[14]; } $time_1 = strtotime("now"); $today_date = date("ymd",$time_1); $today_time = date("his",$time_1); $Total = $Price * $QTY; $Shipping = $Ship * $QTY; $ID = "$today_date$today_time"; include("database.php"); mysql_select_db("brandysbeanies", $con); $sql="INSERT INTO productorders (ClientID,OrderID,Productname,Productdescription,Cost,Price,Quantity,Shipping,Total,Photo) VALUES ('$UserID','$ID','$Name','$Description','$Cost','$Price','$QTY','$Shipping','$Total','$Image1')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } include("cart.php"); ?> This is the display page. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title></title> <meta http-equiv="generator" content="CoffeeCup HTML Editor (www.coffeecup.com)" /> <meta name="created" content="Mon, 06 Sep 2010 07:35:27 GMT" /> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta name="description" content="" /> <meta name="keywords" content="" /> <meta http-equiv="Page-Enter" content="revealtrans(duration=2,transition=22)"> <style type="text/css"> a:link {text-decoration: none;} a:visited {text-decoration: none;} </style> <style type="text/css"> BODY { SCROLLBAR-FACE-COLOR: #0E98E0; SCROLLBAR-HIGHLIGHT-COLOR: #000000; SCROLLBAR-SHADOW-COLOR: #000000; SCROLLBAR-3DLIGHT-COLOR: #000000; SCROLLBAR-ARROW-COLOR: #000000; SCROLLBAR-TRACK-COLOR: #000000; SCROLLBAR-DARKSHADOW-COLOR: #000000; background-image:url('Images/background.gif'); } </style> <style type="text/css"> div.Object1 { position:absolute; top:0%; left:0%; z-index:2; width:100%; height:20%;} div.Object2 { position:absolute; top:20%; left:0%; z-index:2; width:100%; height:80%;} </style> </head> <body> <div class="Object1"> <table border="0" width="100%" cellpadding="5" cellspacing="5"><tr><td> <font size="7" face="AR CHRISTY"><b><u>YOUR SHOPPING CART</u></b></font> </td></tr></table> </div> <div class="Object2"> <table border='1' width='100%'> <tr><!-- Row 1 --> <td colspan="2" width='70%' align='left' valign='top'><font size="4" face="AR CHRISTY"><b>PRODUCT</b></font></td><!-- Col 2 --> <td width='15%' align='center' valign='top'><font size="4" face="AR CHRISTY"><b>QUANTITY</b></font></td><!-- Col 3 --> <td width='15%' align='center' valign='top'><font size="4" face="AR CHRISTY"><b>PRICE</b></font></td><!-- Col 4 --> </tr> <?PHP $UserID = session_id(); include("database.php"); mysql_select_db("brandysbeanies", $con); $result = mysql_query("SELECT * FROM productorders WHERE ClientID='$UserID'"); while($row = mysql_fetch_array($result)) { echo" <tr><!-- Row 2 --> <td width='20%' align='center' valign='top'><a href='Products3.php?SKU=$row[0]' style='color:#000000;'><img src='$row[10]' width=60% height=60% alt='' border='1'></a></td><!-- Col 2 --> <td width='50%' align='left' valign='top'><font size='3' face='Comic Sans MS'><b>$row[3]</b><br>$row[4]</font></td><!-- Col 2 --> <td width='15%' align='center' valign='top'><font size='3' face='Comic Sans MS'>$row[7]</font></td><!-- Col 3 --> <td width='15%' align='center' valign='top'><font size='3' face='Comic Sans MS'>$row[9]</font></td><!-- Col 4 --> </tr>"; } echo" <tr><!-- Row 2 --> <td width='85%' colspan=3 align='right' valign='top'><font size='4' face='AR CHRISTY'><b>SHIPPING</b></font></td><!-- Col 3 --> <td width='15%' valign='top'></td><!-- Col 4 --> </tr>"; echo" <tr><!-- Row 2 --> <td width='85%' colspan=3 align='right' valign='top'><font size='4' face='AR CHRISTY'><b>TOTAL</b></font></td><!-- Col 3 --> <td width='15%' valign='top'></td><!-- Col 4 --> </tr>"; ?> </table> </div> </body> </html>
  8. I am needing help with totaling the orders. Please help!! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title></title> <meta http-equiv="generator" content="CoffeeCup HTML Editor (www.coffeecup.com)" /> <meta name="created" content="Mon, 06 Sep 2010 07:35:27 GMT" /> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta name="description" content="" /> <meta name="keywords" content="" /> <meta http-equiv="Page-Enter" content="revealtrans(duration=2,transition=22)"> <style type="text/css"> a:link {text-decoration: none;} a:visited {text-decoration: none;} </style> <style type="text/css"> BODY { SCROLLBAR-FACE-COLOR: #0E98E0; SCROLLBAR-HIGHLIGHT-COLOR: #000000; SCROLLBAR-SHADOW-COLOR: #000000; SCROLLBAR-3DLIGHT-COLOR: #000000; SCROLLBAR-ARROW-COLOR: #000000; SCROLLBAR-TRACK-COLOR: #000000; SCROLLBAR-DARKSHADOW-COLOR: #000000; background-image:url('Images/background.gif'); } </style> <style type="text/css"> div.Object1 { position:absolute; top:0%; left:0%; z-index:2; width:100%; height:20%;} div.Object2 { position:absolute; top:20%; left:0%; z-index:2; width:100%; height:80%;} </style> </head> <body> <div class="Object1"> <table border="0" width="100%" cellpadding="5" cellspacing="5"><tr><td> <font size="7" face="AR CHRISTY"><b><u>YOUR SHOPPING CART</u></b></font> </td></tr></table> </div> <div class="Object2"> <table border='1' width='100%'> <tr><!-- Row 1 --> <td colspan="2" width='70%' align='left' valign='top'><font size="4" face="AR CHRISTY"><b>PRODUCT</b></font></td><!-- Col 2 --> <td width='15%' align='center' valign='top'><font size="4" face="AR CHRISTY"><b>QUANTITY</b></font></td><!-- Col 3 --> <td width='15%' align='center' valign='top'><font size="4" face="AR CHRISTY"><b>PRICE</b></font></td><!-- Col 4 --> </tr> <?PHP $UserID = session_id(); include("database.php"); mysql_select_db("brandysbeanies", $con); $result = mysql_query("SELECT * FROM productorders WHERE ClientID='$UserID'"); while($row = mysql_fetch_array($result)) { echo" <tr><!-- Row 2 --> <td width='20%' align='center' valign='top'><a href='Products3.php?SKU=$row[0]' style='color:#000000;'><img src='$row[10]' width=60% height=60% alt='' border='1'></a></td><!-- Col 2 --> <td width='50%' align='left' valign='top'><font size='3' face='Comic Sans MS'><b>$row[3]</b><br>$row[4]</font></td><!-- Col 2 --> <td width='15%' align='center' valign='top'><font size='3' face='Comic Sans MS'>$row[7]</font></td><!-- Col 3 --> <td width='15%' align='center' valign='top'><font size='3' face='Comic Sans MS'>$row[9]</font></td><!-- Col 4 --> </tr>"; } echo" <tr><!-- Row 2 --> <td width='85%' colspan=3 align='right' valign='top'><font size='4' face='AR CHRISTY'><b>SHIPPING</b></font></td><!-- Col 3 --> <td width='15%' valign='top'></td><!-- Col 4 --> </tr>"; echo" <tr><!-- Row 2 --> <td width='85%' colspan=3 align='right' valign='top'><font size='4' face='AR CHRISTY'><b>TOTAL</b></font></td><!-- Col 3 --> <td width='15%' valign='top'></td><!-- Col 4 --> </tr>"; ?> </table> </div> </body> </html>
  9. I need to set my script here to change the CHMOD settings to 644. The images that are uploaded into the Yahoo server are not able to be accessed. I believe this is the CHMOD, however I have never worked with CHMOD. Please help, or if you notice an error in my coding please let me know. <?php $Name = $_POST['Name']; $Pic = $_FILES["file"] ["name"]; if ((($_FILES["file"] ["type"] == "image/gif") || ($_FILES["file"] ["type"] == "image/jpeg") || ($_FILES["file"] ["type"] == "image/pjpeg")) && ($_FILES["file"] ["size"] < 100000)) { if ($_FILES["file"] ["error"] > 0) { echo "Return Code: " . $_FILES["file"] ["error"] . "<br />"; } else { if (file_exists("../Graphics/" . $_FILES["file"] ["name"])) { include("../Admin/photos.php"); echo $_FILES["file"] ["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"] ["tmp_name"], "../Graphics/" . $_FILES["file"] ["name"]); chmod("$pic",0644); } } } else { echo "<font size='5' face='Arial'><b>Invalid file</b></font>"; } $Category = $_POST['Category']; include('database.php'); mysql_select_db("bluemoonmastiff", $con); $good_data = $_POST; foreach($good_data as $field => $value) { if($field != "submitted") { $field_array[] = $field; $clean = strip_tags(trim($value)); $escaped = mysqli_real_escape_string($cxn,$clean); $value_array[] = $escaped; } } $fields = implode(",",$field_array); $values = implode('","',$value_array); $sql = "INSERT INTO gallery SET Name='$Name',PicAddress='Graphics/$Pic',Category='$Category'"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "<font size='5' face='Arial'><b>Picture Upload Complete</b></font>"; ?>
  10. I am trying to write a script that pulls my most current invoice from the data base for a client. I am not sure exactly how to do it. I got everything in order but how to do that. I cannot release the coding because of financial sensativity, however if some one can just point me in the right direction on that coding piece I would be very appreciative.
  11. I am editing a script that enters data into a database from a shopping cart. I am adding a constant of 3.95 on every order for shipping. The way the information is each product is added into the database with an order number, a customer number, product name, price and quantity. I cant get a new entry code to enter anything into the database. Here is the PHP coding. It uses alot fo diffferent files in each page, but this is the php part. <?php /***************************************************************************** * * * Shop-Script FREE * * Copyright (c) 2005 WebAsyst LLC. All rights reserved. * * * ****************************************************************************/ //place order: save to the database, send notifications, gateway processing if (isset($_GET["order_placement_result"])) //show 'order successful' page { $smarty->assign("order_id", $_SESSION["order_id"]); $smarty->assign("order_amount", $_SESSION["order_amount"]); $smarty->assign("main_content_template", "order_place.tpl.html"); $smarty->assign("order_is_placed", $_GET["order_placement_result"]); } else if (isset($_POST["complete_order"])) //place order { //shopping cart items count $c = 0; if (isset($_SESSION["gids"])) for ($j=0; $j<count($_SESSION["gids"]); $j++) if ($_SESSION["gids"][$j]) $c += $_SESSION["counts"][$j]; //not empty? if (isset($_SESSION["gids"]) && $c) { //insert order into database db_query("insert into ".ORDERS_TABLE." (order_time, cust_firstname, cust_lastname, cust_email, cust_country, cust_zip, cust_state, cust_city, cust_address, cust_phone) values ('".get_current_time()."','".$_POST["first_name"]."','".$_POST["last_name"]."','".$_POST["email"]."','".$_POST["country"]."','".$_POST["zip"]."','".$_POST["state"]."','".$_POST["city"]."','".$_POST["address"]."','".$_POST["phone"]."');") or die (db_error()); $oid = db_insert_id(); //order ID //now move shopping cart content to the database $k = 0; //total cart value $products = array(); $adm = ""; //order notification for administrator for ($i=0; $i<count($_SESSION["gids"]); $i++) if ($_SESSION["gids"][$i]) { $q = db_query("SELECT name, Price, product_code FROM ".PRODUCTS_TABLE." WHERE productID='".$_SESSION["gids"][$i]."'") or die (db_error()); if ($r = db_fetch_row($q)) { //product info $tmp = array( $_SESSION["gids"][$i], $r[0], $_SESSION["counts"][$i], ($_SESSION["counts"][$i]*$r[1])." ".$currency_iso_3, $r[2] ); $df = 1; $fd = 3.95; //store ordered products info into database $articul = trim($tmp[4]) ? "[".$tmp[4]."] " : ""; db_query("insert into ".ORDERED_CARTS_TABLE." (orderID, productID, name, Price, Quantity) values ('$oid', '".$tmp[0]."', '".$articul.$tmp[1]."', '".$r[1]."', '".$tmp[2]."');"); $products[] = $tmp; //update order amount $k += $_SESSION["counts"][$i]*$r[1]; //order notification for administrator - update $adm .= $articul.$tmp[1]." (x".$tmp[2]."): ".$tmp[3]."\n"; } } //assign order content to smarty $smarty_mail->assign("order_content", $products); $smarty_mail->assign("order_total", $k." ".$currency_iso_3); $smarty_mail->assign("order_id", $oid); $smarty_mail->assign("order_custname", $_POST["first_name"]." ".$_POST["last_name"]); $smarty_mail->assign("order_shipping_address", $_POST["address"]."\n".$_POST["city"]." ".$_POST["state"]." ".$_POST["zip"]."\n".$_POST["country"]); $_SESSION["order_id"] = $oid; $_SESSION["order_amount"] = $k; //send message to customer mail($_POST["email"], EMAIL_CUSTOMER_ORDER_NOTIFICATION_SUBJECT, $smarty_mail->fetch("order_notification.tpl.html"), "From: \"".CONF_SHOP_NAME."\"<".CONF_GENERAL_EMAIL.">\n".stripslashes(EMAIL_MESSAGE_PARAMETERS)."\nReturn-path: <".CONF_GENERAL_EMAIL.">"); //notification for administrator $od = STRING_ORDER_ID.": $oid\n\n"; $adm .= "\n".CUSTOMER_FIRST_NAME." ".$_POST["first_name"]."\n".CUSTOMER_LAST_NAME." ".$_POST["last_name"]."\n".CUSTOMER_ADDRESS.": ".$_POST["country"].", ".$_POST["zip"].", ".$_POST["state"].", ".$_POST["city"].", ".$_POST["address"]."\n".CUSTOMER_PHONE_NUMBER.": ".$_POST["phone"]."\n".CUSTOMER_EMAIL.": ".$_POST["email"]; mail(CONF_ORDERS_EMAIL, EMAIL_ADMIN_ORDER_NOTIFICATION_SUBJECT, $od.$adm, "From: \"".CONF_SHOP_NAME."\"<".CONF_GENERAL_EMAIL.">\n".stripslashes(EMAIL_MESSAGE_PARAMETERS)."\nReturn-path: <".CONF_GENERAL_EMAIL.">"); unset($_SESSION["gids"]); unset($_SESSION["counts"]); //show order placement result header("Location: index.php?order_placement_result=1"); } else //empty shopping cart { header("Location: index.php?shopping_cart=yes"); } } ?>
  12. I am building a shopping cart from ground up and I am having a problem with the products being reentered into the DB. I need help trying to stop it from being entered twice when refreshed. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Tickle Creek Candles</title> <meta http-equiv="generator" content="CoffeeCup HTML Editor (www.coffeecup.com)" /> <meta name="created" content="Tue, 22 Jun 2010 22:09:16 GMT" /> <meta name="description" content="" /> <meta name="keywords" content="" /> <style type="text/css"> <!-- /* Don't underline links */ a:link {text-decoration: none;} a:visited {text-decoration: none;} --> </style> <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="ddaccordion.js"> /*********************************************** * Accordion Content script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com) * Visit http://www.dynamicDrive.com for hundreds of DHTML scripts * This notice must stay intact for legal use ***********************************************/ </script> <script type="text/javascript"> ddaccordion.init({ headerclass: "expandable", //Shared CSS class name of headers group that are expandable contentclass: "categoryitems", //Shared CSS class name of contents group revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover" mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover collapseprev: true, //Collapse previous content (so only one open at any time)? true/false defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed) animatedefault: false, //Should contents open by default be animated into view? persiststate: true, //persist state of opened contents within browser session? toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"] togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs) animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow" oninit:function(headers, expandedindices){ //custom code to run when headers have initalized //do nothing }, onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed //do nothing } }) </script> <style type="text/css"> .arrowlistmenu{ width: 100%; /*width of accordion menu*/ } .arrowlistmenu .menuheader{ /*CSS class for menu headers in general (expanding or not!)*/ font: bold 14px Arial; color: White; background: black url(Graphics/titlebar.png) repeat-x center left; margin-bottom: 10px; /*bottom spacing between header and rest of content*/ text-transform: uppercase; padding: 4px 0 4px 10px; /*header text is indented 10px*/ cursor: hand; cursor: pointer; } .arrowlistmenu .openheader{ /*CSS class to apply to expandable header when it's expanded*/ background-image: url(Graphics/titlebar-active.png); } .arrowlistmenu ul{ /*CSS for UL of each sub menu*/ list-style-type: none; margin: 0; padding: 0; margin-bottom: 8px; /*bottom spacing between each UL and rest of content*/ } .arrowlistmenu ul li{ padding-bottom: 2px; /*bottom spacing between menu items*/ } .arrowlistmenu ul li a{ color: #FFFFFF; display: block; padding: 2px 0; padding-left: 19px; /*link text is indented 19px*/ text-decoration: none; font-weight: bold; border-bottom: 0px solid #dadada; font-size: 100%; } .arrowlistmenu ul li a:visited{ color: #FFFFFF; } .arrowlistmenu ul li a:hover{ /*hover state CSS*/ color: #FF0000; background-color: #400000; } </style> <?php session_start(); ?> </head> <body bgcolor="#FFFFFF" text="#FFFFFF" link="#FFFFFF" vlink="#FFFFFF" alink="#FF0000" background="Graphics/wood018.jpg"> <div id="1" style="height:23%;width:15%;position:absolute;top:0%;left:10%;background-color:#400000;border-left:solid;"> <img src="Graphics/Logo.jpg" width="100%" height="100%" alt="" title="" border="0" align="" /> </div> <div id="2" style="height:12%;width:65%;position:absolute;top:0%;left:25%;background-color:#400000;text-indent:2%;border-right:solid;border-left:solid;"> <font size="7" face="AR ESSENCE"><b><u>Tickle Creek Candles</u></b></font> </div> <div id="3" style="height:6%;width:65%;position:absolute;top:12%;left:25%;background-color:#400000;text-indent:2%;border-right:solid;border-left:solid;"> <font size="5" face="AR ESSENCE"><b>Hand Made Candles</b></font> </div> <div id="4" style="min-height:77%;width:15%;position:absolute;top:23%;left:10%;background-color:#400000;text-indent:2%;border-left:solid;"> <font size="6" face="AR ESSENCE"><u><b><center>Contents</center></b></u></font> <div class="arrowlistmenu"> <h3 class="menuheader" style="cursor: default"><a href="Index.php">Home</a></h3> <h3 class="menuheader expandable">Products</h3> <ul class="categoryitems"> <li><a href="Pies.php">PIES</a></li> <li><a href="Bakery.php">BAKERY GOODS</a></li> <li><a href="Containers.php">CONTAINERS</a></li> <li><a href="Melts.php">MELTS</a></li> <li><a href="Warmers.php">WARMERS</a></li> </ul> <h3 class="menuheader" style="cursor: default"><a href="About.php">About Us</a></h3> <h3 class="menuheader" style="cursor: default"><a href="Contact.php">Contact Us</a></h3> </div> </div> <div id="5" style="min-height:82%;width:65%;position:absolute;top:18%;left:25%;background-color:#400000;border-right:solid;border-left:solid;border-top:solid;"> <br /> <font size="6" face="AR ESSENCE"> <b>Shopping Cart</b> </font> <br /><br /> <?php $_SESSION['Identifier'] = session_id(); $Identifier = $_SESSION['Identifier']; $ID = $_POST['ID']; $cat = $_POST['cat']; $Code = $_POST['Price']; include("database.php"); mysql_select_db("tc", $con); $result = mysql_query("SELECT * FROM Pricing WHERE Code='$Code'"); while($row = mysql_fetch_array($result)) { $Price = $row[2]; } $result = mysql_query("SELECT * FROM Products WHERE ID='$ID'"); while($row = mysql_fetch_array($result)) { $SKU = $row[0]; $Name = $row[1]; $QDesc = $row[2]; $Desc = $row[3]; $Price = $row[4]; $Cat = $row[5]; $Cost = $row[6]; $Qty = $row[7]; $Pic = $row[8]; $Opt1 = $row[9]; $Opt2= $row[10]; $Opt3 = $row[11]; } $result = mysql_query("SELECT * FROM shopping_cart WHERE Identifier='$Identifier'"); while($row = mysql_fetch_array($result)) { If((isset($SKU2)) == FALSE) { $SKU2 = $row[3]; } ELSE { } } IF($SKU2 == $SKU) { } Else { include("database.php"); mysql_select_db("tc", $con); $sql = "INSERT INTO shopping_cart (Identifier) VALUES ('$Identifier')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } $sql = "UPDATE shopping_cart SET Product='$Name', SKU='$SKU', Quantity='1', Price='$Price', PicAddress='$Pic' WHERE Identifier='$Identifier' AND Product=''"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } } print "<table border='0' width='95%' align='center'>"; print "<tr><!-- Row 1 --> <td width='10%'><b><u>DELETE</u></b></td><!-- Col 1 --> <td width='45%' colspan='2'><b><u>PRODUCT</u></b></td><!-- Col 2 --> <td width='15%'><b><u>QUANTITY</u></b></td><!-- Col 4 --> <td width='15%' align='right'><b><u>PRICE</u></b></td><!-- Col 5 --> <td width='15%' align='right'><b><u>TOTAL</u></b></td><!-- Col 6 --> </tr>"; include("database.php"); mysql_select_db("tc", $con); $result = mysql_query("SELECT * FROM shopping_cart WHERE Identifier= '$Identifier'"); while($row = mysql_fetch_array($result)) { echo "<tr><!-- Row 2 --> <td width='10%' valign='middle'><center><input type='checkbox' name='Delete' value='$row[0]'></center></td><!-- Col 1 --> <td width='15%'><img src='$row[10]' width='100%' height='100%' alt='' border='1'></td><!-- Col 2 --> <td width='30%' valign='top'>$row[2]</td><!-- Col 3 --> <td width='15%' valign='top'><input type='text' name='Quantity' value='$row[4]' size='10' style='background-color:#400000;border:none;color:#FFFFFF;text-align:right;'></td><!-- Col 4 --> <td width='15%' valign='top' align='right'><input type='text' name='Price' value='$$row[5]' size='10' style='background-color:#400000;border:none;color:#FFFFFF;text-align:right;'></td><!-- Col 5 --> <td width='15%' valign='top' align='right'><b>"; $sub = $row[4] * $row[5]; echo "$$sub</b></td><!-- Col 6 --> </tr>"; } print "<tr><!-- Row 3 --> <td width='85%' colspan='5' align='right' style='border-top:solid;'><b>SUB TOTAL</b></td><!-- Col 1 --> <td width='15%' align='right' style='border-top:solid;'><b>$</b>"; echo "</td><!-- Col 6 --> </tr> <tr><!-- Row 4 --> <td width='85%' colspan='5' align='right'><b>TAXES</b></td><!-- Col 1 --> <td width='15%' align='right'><b></b></td><!-- Col 6 --> </tr> <tr><!-- Row 5 --> <td width='85%' colspan='5' align='right'><b>SHIPPING</b></td><!-- Col 1 --> <td width='15%' align='right'><b>$</b></td><!-- Col 6 --> </tr> <tr><!-- Row 6 --> <td width='85%' colspan='5' align='right'><b>GRAND TOTAL</b></td><!-- Col 1 --> <td width='15%' align='right'><b>$</b></td><!-- Col 6 --> </tr> <tr><!-- Row 6 --> <td width='70%' colspan='4' align='right'><br /><input type='submit' name='submit' value='UPDATE SHOPPING CART'></td><!-- Col 1 --> <td width='30%' colspan='2' align='right'><br /><input type='submit' name='submit' value='CONTINUE PURCHASE'></td><!-- Col 6 --> </tr> </table>"; ?> </div> </body> </html>
  13. I tried this and it only caused another error. I had to put it back. The error is not just the pulling but when i view the file directly on the server, it doesnt allow me access.
  14. I have a file upload script I am using to upload photos to a file on a yahoo server, however after they are uploaded, the server is not allowing access to the file. It gives the following error message: " Sorry, Forbidden. You don't have permission to access this URL on this server. Additionally, a 410 Gone error was encountered while trying to use an ErrorDocument to handle the request. Please check the URL for proper spelling and capitalization. If you're having trouble locating a destination on Yahoo!, try visiting the Yahoo! home page or look through a list of Yahoo!'s online services. Also, you may find what you're looking for if you try searching below. " I am not able to access the photos, even though they are showing up on the server. I am thinking maybe thr script is in need of a CHMOD code, but im not familiar with it. I was wondering if you would add it into a an upload script, or if you would us it when opening the file in the script that pulls its location from a php table. The upload script follows: <?php if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 200000)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { if (file_exists("../Graphics/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "../Graphics/" . $_FILES["file"]["name"]); } } } $Name = $_POST['Name']; $Pic = $_FILES["file"] ["name"]; $Category = $_POST['Category']; include("database.php"); mysql_select_db("bluemoonmastiff", $con); $sql="INSERT INTO gallery (Name,PicAddress,Category) VALUES ('$Name','../Graphics/$Pic','$Category')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); echo "Invalid file"; } else { include("photos.php"); echo "File Uploaded" } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> <style type="text/css"> a:link {text-decoration: none;} a:visited {text-decoration: none;} </style> <script type="text/javascript" src="jquery-1.2.6.pack.js"></script> <style type="text/css"> /*Make sure your page contains a valid doctype at the top*/ #simplegallery1{ //CSS for Simple Gallery Example 1 position: relative; /*keep this intact*/ visibility: hidden; /*keep this intact*/ border: 2px solid darkred; border-color: #FFFFFF; } #simplegallery1 .gallerydesctext{ //CSS for description DIV of Example 1 (if defined) text-align: left; padding: 2px 5px; } </style> <script type="text/javascript" src="simplegallery.js"> /*********************************************** * Simple Controls Gallery- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more ***********************************************/ </script> <script type="text/javascript"> var mygallery=new simpleGallery({ wrapperid: "simplegallery1", //ID of main gallery container, dimensions: [280, 200], //width/height of gallery in pixels. Should reflect dimensions of the images exactly imagearray: [ <?php Include("database.php"); mysql_select_db("bluemoonmastiff", $con); $result = mysql_query("SELECT * FROM gallery WHERE Category='Pepper'"); while($row = mysql_fetch_array($result)) { echo "$row[7]"; echo "$row[2]"; echo "$row[8]"; } ?> ['../Graphics/bmm_Logo_Slide.jpg', '', '', ''] ], autoplay: [true, 3500, 1000], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int] persist: false, //remember last viewed slide and recall within same session? fadeduration: 500, //transition duration (milliseconds) oninit:function(){ //event that fires when gallery has initialized/ ready to run //Keyword "this": references current gallery instance (ie: try this.navigate("play/pause")) }, onslide:function(curslide, i){ //event that fires after each slide is shown //Keyword "this": references current gallery instance //curslide: returns DOM reference to current slide's DIV (ie: try alert(curslide.innerHTML) //i: integer reflecting current image within collection being shown (0=1st image, 1=2nd etc) } }) </script> </head> <body bgcolor="#000000" text="#FFFFFF" link="#FF0000" vlink="#FF0000" alink="#FFFFFF"> <div style="position:absolute;left:2%;top:5%;height:79%;width:16%;"> <center> <font size="5" face="Arial"><b><u>Site Guide</u></b></font><br><br> <font size="4" face="Arial"><a href="index.html">Home</a></font><br><br> <font size="4" face="Arial"><a href="girls.php">Our Girls</a></font><br><br> <font size="4" face="Arial"><a href="guys.php">The Guys</a></font><br><br> <font size="4" face="Arial"><a href="puppies.php">The Puppies</a></font><br><br> <font size="4" face="Arial"><a href="about.php">Our Story</a></font><br><br> <font size="4" face="Arial"><a href="contact.php">Contact Us</a></font><br><br> <font size="4" face="Arial"><a href="purchase.php">Purchase</a></font><br><br> </center> </div> <div style="position:absolute;left:18%;top:5%;height:45%;width:26%;"> <img src="../Graphics/bmm_Logo.jpg" width="100%" height="99%" alt="" border="1" align="" style="border-color:#FFFFFF;"> </div> <div style="position:absolute;left:44%;top:5%;height:79%;width:55%;"> <font size="6" face="Arial"><b><u><center>Pepper</center></u></b></font><br><br> <center><div id="simplegallery1"></div></center><br><br> <font size="3" face="Arial"> <?php include("database.php"); mysql_select_db("bluemoonmastiff", $con); $result = mysql_query("SELECT * FROM girls WHERE page='pepper'"); while($row = mysql_fetch_array($result)) { echo "<center>$row[2]</center>"; } ?> </font> </div> <div style="position:absolute;left:18%;top:51%;height:33%;width:26%;"> <br> <font size="5" face="Arial"><b><center><a href="sadie.php">Sadie</a></center></b></font><br> <font size="5" face="Arial"><b><center><a href="sierra.php">Sierra</a></center></b></font><br> <font size="5" face="Arial"><b><center><a href="pepper.php">Pepper</a></center></b></font><br> </div> <div style="position:absolute;left:2%;top:85%;height:13%;width:98%;"> </div> </body> </html> I appreciate any help you can provide!!
  15. So im having an issue with uploading files to the server on yahoo using a script I wrote. I have it to where it uploads the files and put them where they need to go, however the server wont recongise them as being authorized files. When I look they look normal and everything. When I upload the same file thorugh their upload page it works. It is acting as if it has a special code written to it when its uploaded. Here is the coding <?php if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 200000)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { if (file_exists("../Graphics/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "../Graphics/" . $_FILES["file"]["name"]); } $Name = $_POST['Name']; $Pic = $_FILES["file"] ["name"]; $Category = $_POST['Category']; include("database.php"); mysql_select_db("bluemoonmastiff", $con); $sql="INSERT INTO gallery (Name,PicAddress,Category) VALUES ('$Name','../Graphics/$Pic','$Category')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } include("photos.php"); } } else { echo "Invalid file"; } ?>
  16. Try going to www.w3school.com and you will be able to find instruction there on both coding types. Try www.dynamicdrive.com you will be able to find codes already compeleted there and instructions about editing them and intigrating them into your coding.
  17. This sounds like DHTML coding or maybe Java Script, that is if your talking about a drop down menu, or a tab menu. Is this what your talking about?
  18. I wrote a script that i use on my WAMP, and it works jus fine there, but I am having trouble getting it to work on the website server. I have double and triple checked this code, and been working it for two days now!! Im out of ideas... Any suggestions guys? <?php $Name = $_POST['Name']; $Pic = $_FILES["file"] ["name"]; if ((($_FILES["file"] ["type"] == "image/gif") || ($_FILES["file"] ["type"] == "image/jpeg") || ($_FILES["file"] ["type"] == "image/pjpeg")) && ($_FILES["file"] ["size"] < 100000)) { if ($_FILES["file"] ["error"] > 0) { echo "Return Code: " . $_FILES["file"] ["error"] . "<br />"; } else { if (file_exists("../Graphics/" . $_FILES["file"] ["name"])) { include("EditWebSiteMain.php"); echo $_FILES["file"] ["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"] ["tmp_name"], "../Graphics/" . $_FILES["file"] ["name"]); } } include('database.php'); mysql_select_db("bluemoonmastiff", $con); $sql = "INSERT INTO gallery (Name,PicAddress,Category) VALUES ('$Name','$Pic','$Category')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } include("photos.php"); echo "<font size='5' face='Arial' color='#FF8000' style='position:absolute;top:3%;right:3%;'><b>Picture Upload Complete</b></font>"; ?>
  19. it doesnt give an error, it just wont process to grant access. It keeps pulling back as incorrect username and password. Its acting like it cant pull the information from the database to us the IF coding to compare it. and grant the access to the page.
  20. hey guys I have a script I have used on my internal server for a couple years now and its worked just fine. I appliedit to a recent script online and it is not processing correctly. i was wondering if I might be able to get a second set of eyes on this one. Thanks guys. <?php session_start(); $_SESSION['username'] = $_POST['username']; if(isset($UserName2) == FALSE) { $UserName2 = 'none'; } Else { } $UserName = $_POST['username']; $Pass = $_POST['password']; include("database.php"); mysql_select_db("bluemoonmastiff", $con); $result = mysql_query("SELECT * FROM Password WHERE username='$UserName' AND password='$Pass'"); while($row = mysql_fetch_array($result)) { $UserName2 = $row[3]; $Pass2 = $row[4]; } if($UserName == $UserName2 AND $Pass == $Pass2) { include("database.php"); mysql_select_db("bluemoonmastiff", $con); $good_data = $_POST; foreach($good_data as $field => $value) { if($field != "submitted") { $field_array[] = $field; $clean = strip_tags(trim($value)); $escaped = mysqli_real_escape_string($cxn,$clean); $value_array[] = $escaped; } } $fields = implode(",",$field_array); $values = implode('","',$value_array); $sql = "INSERT INTO signin ($fields) VALUES (\"$values\")"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } include("Indexmain.php"); } else { include("Index.php"); } ?>
  21. Sorry about that, i thought I had put the full coding in but only got a part of it. The full page coding is included. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> <style type="text/css"> a:link {text-decoration: none;} a:visited {text-decoration: none;} </style> <?php IF((isset($_POST['Delete'])) == TRUE) { $Delete = $_POST['Delete']; } ELSE { $Delete = ""; } include('database.php'); $cxn = mysqli_connect($host,$user,$password,$dbname) or die ("Couldn't connect to server"); $sql = "DELETE FROM messages WHERE ID='$Delete'"; $result = mysqli_query($cxn,$sql) or die("Couldn't execute query: ".mysqli_error($cxn)); ?> </head> <body bgcolor="#000000" text="#FFFFFF" link="#FF0000" vlink="#FF0000" alink="#FFFFFF"> <div style="position:absolute;left:2%;top:5%;height:79%;width:16%;"> <center> <font size="5" face="Arial"><b><u>Site Guide</u></b></font><br><br> <font size="4" face="Arial"><a href="indexmain.php">Home</a></font><br><br> <font size="4" face="Arial"><a href="messages.php">Messages</a></font><br><br> <font size="4" face="Arial"><a href="orders.php">Order Requests</a></font><br><br> <font size="4" face="Arial"><a href="girls.php">Edit The Girls</a></font><br><br> <font size="4" face="Arial"><a href="guys.php">Edit The Guys</a></font><br><br> <font size="4" face="Arial"><a href="puppies.php">Edit The Puppies</a></font><br><br> <font size="4" face="Arial"><a href="about.php">Edit Our Story</a></font><br><br> <font size="4" face="Arial"><a href="photos.php">Edit Photos</a></font><br><br> </center> </div> <div style="position:absolute;left:18%;top:5%;height:45%;width:26%;"> <img src="../Graphics/bmm_Logo.jpg" width="100%" height="99%" alt="" border="1" align="" style="border-color:#FFFFFF;"> </div> <div style="position:absolute;left:44%;top:5%;height:79%;width:55%;max-width:55%;"> <font size="6" face="Arial"><b><center>Administration Area</center></b></font><br><br> <!-- Start of FORM --> <form method="POST" action="messages.php"> <center> <table border="0" width="90%"> <tr><!-- Row 1 --> <td align="left"><input type="submit" value="Delete"></td><!-- Col 1 --> <td></td><!-- Col 2 --> </tr> </table> </center> <center><table border="1" width="90%" style="border-bottom:none;border-left:none;border-right:none;border-top:none;"> <tr> <td valign='top' align="center" style="border-bottom:none;border-left:none;border-right:none;border-top:none;">Check</td><!-- Col 1 --> <td valign='top' style="border-bottom:none;border-left:none;border-right:none;border-top:none;">Date</td><!-- Col 1 --> <td style="border-bottom:none;border-left:none;border-right:none;border-top:none;"> Subject </td></tr><!-- Col 1 --> <?php include('database.php'); $cxn = mysqli_connect($host,$user,$password,$dbname) or die ("Couldn't connect to server"); $sql = "SELECT * FROM messages WHERE File='Inbox'"; $result = mysqli_query($cxn,$sql); while($row = mysqli_fetch_row($result)) { echo "<tr> <td valign='bottom' width='10%' align='center'><input type='checkbox' name='Delete' value='$row[0]'></td>"; echo "</form><form method='POST' action='messages2.php'>"; echo "<td valign='bottom' width='15%'>$row[4]</td><!-- Col 1 --> <td valign='bottom' width='60%'> <input type='hidden' name='ID' value=".$row[0]."> <input type=submit value='".$row[2]."' style='background-color:transparent;border:none;font-family:arial;font-size:inherit;font-weight:bold;color:#FF0000;'> </td></tr><!-- Col 1 --> "; echo "</form>"; } print "</table></center>"; ?> </form> <!-- End of FORM --> </div> <div style="position:absolute;left:18%;top:51%;height:33%;width:26%;"> </div> <div style="position:absolute;left:2%;top:85%;height:13%;width:98%;"> </div> </body> </html>
  22. I am writing a code that displays the messages from a database and then has the option to delete a message. Everything is working great except that I can only delete the first message in the list of messages every time. Cant seem to figure this one guys.. any help would be appreciated. Here is the code: <font size="6" face="Arial"><b><center>Administration Area</center></b></font><br><br> <!-- Start of FORM --> <form method="POST" action="messages.php"> <center> <table border="0" width="90%"> <tr><!-- Row 1 --> <td align="left"><input type="submit" value="Delete"></td><!-- Col 1 --> <td></td><!-- Col 2 --> </tr> </table> </center> <center><table border="1" width="90%" style="border-bottom:none;border-left:none;border-right:none;border-top:none;"> <tr> <td valign='top' align="center" style="border-bottom:none;border-left:none;border-right:none;border-top:none;">Check</td><!-- Col 1 --> <td valign='top' style="border-bottom:none;border-left:none;border-right:none;border-top:none;">Date</td><!-- Col 1 --> <td style="border-bottom:none;border-left:none;border-right:none;border-top:none;"> Subject </td></tr><!-- Col 1 --> <?php include('database.php'); $cxn = mysqli_connect($host,$user,$password,$dbname) or die ("Couldn't connect to server"); $sql = "SELECT * FROM messages WHERE File='Inbox'"; $result = mysqli_query($cxn,$sql); while($row = mysqli_fetch_row($result)) { echo "<tr> <td valign='bottom' width='10%' align='center'><input type='checkbox' name='Delete' value='$row[0]'></td>"; echo "</form><form method='POST' action='messages2.php'>"; echo "<td valign='bottom' width='15%'>$row[4]</td><!-- Col 1 --> <td valign='bottom' width='60%'> <input type='hidden' name='ID' value=".$row[0]."> <input type=submit value='".$row[2]."' style='background-color:transparent;border:none;font-family:arial;font-size:inherit;font-weight:bold;color:#FF0000;'> </td></tr><!-- Col 1 --> "; echo "</form>"; } print "</table></center>"; ?> </form>
  23. Thanks, I had just realized from reading another post that I forgot the commas between the entries. Thanks again bud.
  24. Im qorking on a information storage program that will print out medical forms an store them in a database. I am currently on the page that you can access a previous medical form and update the form. I have an error in the code and I cant seem to locate it. The error message says that I have an eror in my syntax.. I can seem to find it. I always have trouble with the update part of coding, not sure why. If any one could help I would appreciate it. The program is for my military unit, so it would be a big help and I gotta finish the whole program by the end of the week. Here is the Code <?php $LastName = $_POST['Last_Name']; $DOB = $_POST['DOB']; $SSN = $_POST['SSN']; $TDate = $_POST['Date']; $FirstName = $_POST['First_Name']; $Gender = $_POST['Gender']; $RankGrade = $_POST['Rank_Grade']; $Unit = $_POST['Unit']; $Time = $_POST['Time']; $host = "localhost"; $user = "root"; $password = ""; $dbname = "Medical"; $cxn = mysqli_connect($host,$user,$password,$dbname) or die ("Couldn't connect to server"); $good_data = $_POST; foreach($good_data as $field => $value) { if($field != "submitted") { $field_array[] = $field; $clean = strip_tags(trim($value)); $escaped = mysqli_real_escape_string($cxn,$clean); $value_array[] = $escaped; } } $fields = implode(",",$field_array); $values = implode('","',$value_array); $sql = "UPDATE SF600T01 Last_Name = '$LastName' First_Name = '$FirstName' DOB = '$DOB' Gender = '$Gender' Rank_Grade = '$RankGrade' SSN = '$SSN' Unit = '$Unit' Date = '$TDate' Time = '$Time' WHERE Last_Name='$LastName' AND DOB='$DOB' AND SSN='$SSN' AND Date='$TDate'"; $result = mysqli_query($cxn,$sql) or die("Couldn't execute query: ".mysqli_error($cxn)); include('FM600B02.php'); echo "<font size='3' face='Arial, Bookman Old Style, Georgia' style='position:absolute;right:5%;top:10%;'><center><b>Patient<br>Information<br>Saved</font>"; ?> Thanks Everyone, PFC Litkie US ARMY
  25. Thanks, its actually funny.. Just as your last reply came in, I ran across an article on the internet and I realized I want accessing it from the localhost where it was stored. I tried it and it worked.. Thank you for your help though..
×
×
  • 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.