Jump to content

DJTim666

Members
  • Posts

    212
  • Joined

  • Last visited

    Never

Everything posted by DJTim666

  1. I'm not quite sure what you are trying to say here, but this is what I have. What you have is a table in MySQL, and you want to make it so people can't just refresh and keep making new entries into the table. This is easy to prevent. There are a few options to solve this problem. A) Just use the sleep(amount of seconds in here) function. That function will hault the script for however many seconds you insert. or B) Download the following file, and follow the instructions. It will stop users from refreshing by telling them they need to wait XX amount of seconds to post again. EDIT: There is a sample of the file on this site; http://typrofiles.110mb.com/ FILE: [attachment deleted by admin]
  2. 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
  3. Well, I am off to bed now. If anyone can help please post and I will get to it in the morning !
  4. 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
  5. 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
  6. Thanks, I am using this format for the date; $date = date('l, F d, Y');
  7. mysql_query("INSERT INTO `users` ( `id` , `username` , `password` , `email` , `rp` , `gender` , `birthday` , `date_registered` ) VALUES ( NULL , '$user', '$pass', '$email', '2500', '$gender', '$birthday', '$date' );"); Can anyone help me make a table structure for that information please
  8. Yea, for something like that you are going to need SQL, and thats way over my head.
  9. Do you want to store results that people will get when they search for something. Or do you want to store what people search for? Like if I search for hello, then my search query will be stored.
  10. I am not quite sure what your saying, but if you want information displayed that has been inserted by someone else all you need is PHP. Try this coding. <form method="POST" action="searchresults.php"> <p> First Name: <input name="firstname" type="text" /> <p><input type="submit" value="Submit" /> </form> PHP CODE <?php $firstName = $_POST ['firstname']; echo "First Name: $firstName"; ?> This code will take what the person entered on one page and insert it on another page. Now storing the information inserted by the person uses SQL, and thats a whole new set of coding. There is also a way to store the entered inormation, and then recall it when you need it. Like I said, that is all different coding that I am not very familiar with. Good luck finding everything else you need.
  11. I know, I re-wrote that code because I didn't feel like going through my files to find that file. I just remembered I had that problem, and I needed help. But I just happen to come across it and seen the = sign missing.
  12. <input type="text" name"name" /> Even after 400 times of looking over the same code you would have thought I could catch the missing =. Thanks for the help though. I feel so stupid now rofl.
  13. Yes, it echo's Username: and then it is blank.
  14. Nope, still doesn't do the trick.
  15. Does anyone see anything wrong with this coding? Information.php <html> <body> <form action="script.php" method="post"> Username: <input name="user" type="text" /> <input value="Submit" type="submit" /> </form> </body> </html> Script.php <?php $user = $_POST ['user']; echo "Username: $user"; ?> I have been over the code 400 times, and it should work perfectly. But when I insert it, for some reason it will not post the username entered on the previous page.
  16. Alright, that solves my whole problem lol. Thanks for your help !
  17. I can name a document .php if it has HTML in it, and it will still work? And if that is the case, then thank you for your help
  18. How do I get the information to go inside the cell? The Layout is a different file named layout.html
  19. Ok, I am trying to get the information that someone enter's to insert inside the layout using the include funtion. I do not want to insert the layout on the PHP page because it causes a crap load of problems. I want this information to go inside the cell in the layout. <?php include("menu.php"); echo "Name: $name "; echo "Gender: $gender "; echo "Age: $age "; echo "Sign: $sign "; echo "Height: $height "; echo "Body Type: $btype "; echo "Ethnicity: $ethn "; echo "Smoke?: $smoke "; echo "Drink?: $drink "; echo "Language(s) Spoken: $langue "; echo "Religion: $religion "; echo "Country: $country "; echo "State/Province: $sp "; echo "City/Town: $cit "; echo "Outdoor Activities/Fitness: $oaf "; echo "Entertainment: $enter "; echo "Hobbies and Other: $ho "; echo "Photo: $photo "; ?>
  20. I know, but how do I get information to go directly into the layout with inserting the layout on to the page? Here is the code. <?php $name = $_POST ['name']; $gender = $_POST ['gender']; $age = $_POST ['age']; $sign = $_POST ['sign']; $height = $_POST ['height']; $btype = $_POST ['btype']; $ethn = $_POST ['ethn']; $smoke = $_POST ['smoke']; $drink = $_POST ['drink']; $langue = $_POST ['langue']; $religion = $_POST ['religion']; $country = $_POST ['country']; $sp = $_POST ['sp']; $oaf = $_POST ['oaf']; $enter = $_POST ['enter']; $ho = $_POST ['ho']; $cit = $_POST ['cit/tow']; $photo = $_POST ['photo']; ?> <?php include("menu.php"); echo "Name: $name<br />"; echo "Gender: $gender<br />"; echo "Age: $age<br />"; echo "Sign: $sign<br />"; echo "Height: $height<br />"; echo "Body Type: $btype<br />"; echo "Ethnicity: $ethn<br />"; echo "Smoke?: $smoke<br />"; echo "Drink?: $drink<br />"; echo "Language(s) Spoken: $langue<br />"; echo "Religion: $religion<br />"; echo "Country: $country<br />"; echo "State/Province: $sp<br />"; echo "City/Town: $cit<br />"; echo "Outdoor Activities/Fitness: $oaf<br />"; echo "Entertainment: $enter<br />"; echo "Hobbies and Other: $ho<br />"; echo "Photo: $photo<br />"; ?>
  21. I am having trouble including a layout to my page. When I use the PHP Include function, it just places the layout above the information instead of placing the information inside the layout. I have an open cell on the layout to place the information in, but it is not working. HELPPP! http://typrofiles.110mb.com/profiles/createpro.html When you insert your information it goes to a PHP page where all your information is displayed that you entered. I want the PHP to go inside the layout. Any help would be greatly appreciated. -- DJ
×
×
  • 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.