DJTim666 Posted May 21, 2007 Share Posted May 21, 2007 I have multiple scripts that I need help integrating into my site. They all work fine but they need some teaking here and there. If anyone has a good experience with PHP, and would like to help me please add me to MSN; djtim2005@gmail.com All help is greatly appreciated ! -- DJ Quote Link to comment https://forums.phpfreaks.com/topic/52290-need-help-with-scripts/ Share on other sites More sharing options...
kenrbnsn Posted May 21, 2007 Share Posted May 21, 2007 If you're looking to hire someone (for pay or no pay) please post in the freelancers forum. If you want help here, please post the code. Ken Quote Link to comment https://forums.phpfreaks.com/topic/52290-need-help-with-scripts/#findComment-257970 Share on other sites More sharing options...
DJTim666 Posted May 21, 2007 Author Share Posted May 21, 2007 Alright, here is the code. Maybe someone can help me ! This is a script for Shops; <?php include("layout.php"); include("database.php"); $username = $_COOKIE['username']; if (!$username) { echo "You cannot view this page unless you are logged in!"; include("database.php"); die(""); } $id = $_GET['id']; if ($id==0) { echo "This shop has been closed due to restocking bugs."; include("database.php"); die(""); } $res1 = mysql_query("SELECT * FROM infoshop WHERE id='$id' LIMIT 1"); while ($row1=mysql_fetch_array($res1)) { $shopkeeper = $row1['shopkeeper']; $saying = $row1['greets']; } echo "<center>$shopkeeper welcomes you as you enter the shop: '$saying'<P><a href='?id=$id'>Refresh</a>"; echo "<table style='border:0px solid black' cellpadding=4>"; $i = 0; $res = mysql_query("SELECT * FROM shopstock WHERE shop='$id'"); while ($row=mysql_fetch_array($res)) { $i += 1; if ($i==5) { echo "</tr>"; $i = 1; } if ($i==1) { echo "<tr style='border:0px solid black'>"; } $item = $row['item']; $eitem = base64_encode($item); $res2 = mysql_query("SELECT * FROM items WHERE item='$item' LIMIT 1"); while ($row2=mysql_fetch_array($res2)) { $pic = $row2['pic']; $cost = $row2['ocost']; if ($prem=="yes") { $costoff = $cost * .10; $cost -= $costoff; $cost = round($cost); } $high = $row2['high']; $descrip = $row2['descrip']; } $sstock = $row['id']; $qty = $row['qty']; echo " <td style='border:0px solid black' width='25%'><a href='buyitem.php?id=".$sstock."&ssid=$eitem'> <center><img src='$pic'></a><BR><b>$item</b><BR>$qty in stock <BR> Cost: $cost OP</td>"; } if (mysql_num_rows($res)==0) { echo "<tr><td style='border:0px solid black' bgcolor=red>This shop is out of stock!</td></tr>"; } echo "</table>"; include("database.php"); ?> There is the code. I keep getting the error You need to be logged in to view this page. I am logged in and it's still not working. -- DJ Quote Link to comment https://forums.phpfreaks.com/topic/52290-need-help-with-scripts/#findComment-257977 Share on other sites More sharing options...
DJTim666 Posted May 21, 2007 Author Share Posted May 21, 2007 Well, I am off to bed now. If anyone can help please post and I will get to it in the morning ! Quote Link to comment https://forums.phpfreaks.com/topic/52290-need-help-with-scripts/#findComment-257981 Share on other sites More sharing options...
ryeman98 Posted May 21, 2007 Share Posted May 21, 2007 I'm not exactly sure but you are called database.php a lot. If it's already called and not within an if statement, shouldn't you be able to use it at any time? And, if not, shouldn't you close the connection if you want it to connect later in the script? I'm just learning too so sorry if I'm not much of a help. Quote Link to comment https://forums.phpfreaks.com/topic/52290-need-help-with-scripts/#findComment-257985 Share on other sites More sharing options...
DJTim666 Posted May 21, 2007 Author Share Posted May 21, 2007 I'm not sure. This is a custom script from a professional PHP programmer, so I'm not complaining. After he wrote it he said I would have to change some stuff, but I dont know what stuff to change. -- DJ Quote Link to comment https://forums.phpfreaks.com/topic/52290-need-help-with-scripts/#findComment-258263 Share on other sites More sharing options...
DJTim666 Posted May 21, 2007 Author Share Posted May 21, 2007 Anyone? -- DJ Quote Link to comment https://forums.phpfreaks.com/topic/52290-need-help-with-scripts/#findComment-258278 Share on other sites More sharing options...
kenrbnsn Posted May 22, 2007 Share Posted May 22, 2007 Did you ask the person who wrote it? Ken Quote Link to comment https://forums.phpfreaks.com/topic/52290-need-help-with-scripts/#findComment-258677 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.