Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. Hehe, we all start somewhere. I was just asking because I've never seen that before. I though it may be something that I wasn't aware of...
  2. It may be worth taking a look at pagination. But in your case you can probably get away with using some simple logic. Try it yourself and come back with questions.
  3. Far from it.... You're welcome!
  4. Do you have Apache installed?
  5. He's saying instead of this (which is not consistent anyway because you use <?php and tags): Use: Now you don't have to close PHP after the include and re-open which is pointless...
  6. Try this: $maxdata=mysql_query($query1) or die(mysql_error()); $maxlimit=mysql_fetch_assoc($maxdata); $max=$maxlimit['srno']; $quoteno=rand($min, $max);
  7. Yes I mean use <?php, as the short tags could be enabled/disabled. So for portability reasons you should use the recommended way. Welcome
  8. Please never use short tags to start PHP. Your problem lies here. You never retrieve the ID from the URL so $id is always that last one extracted from the database. You need to change this portion: if($_GET["cmd"]=="delete") { $id = $_GET['id']; $sql = "DELETE FROM $table WHERE id='$id'"; $result = mysql_query($sql); header("Location: delete.php"); } ?>
  9. Yes. It's what you're trying to install now. All it is, is a package for Windows with Apache, MySQL and PHP in it.
  10. Well what is this? $max=`echo "$maxlimit[0] "`; Have you echoed $max and $min?
  11. Another consideration would be to use WAMP, makes the installation much easier.
  12. Are you serious? You need to change the code.
  13. Put it towards the top. I assume you're going to have some validation for user names. Right after you validate you should set the cookie. For now just put it here: ini_set("display_errors", 1); error_reporting(E_ALL); mysql_connect("xxx", "xxx", "xxx") or die(mysql_error()); mysql_select_db("xxxx") or die(mysql_error()); $name = mysql_real_escape_string($_POST['name']); $theme = mysql_real_escape_string($_POST['theme']); mysql_query("INSERT INTO xxx (name, theme, created) VALUES ('$name', '$theme', NOW()) ") or die(mysql_error()); $row_id = mysql_insert_id(); //Put it in a variable for later setcookie("user", $_POST['name'], time()+3600); ?>
  14. Back button doesn't work. There is also no back button when it throws an error like non-numeric entries.
  15. Code?
  16. I use "SQL Inject Me". Seems to work really well as you can customize what kind of attack strings to focus for.
  17. Here's the source. Although it's not in English, not sure what language it is.
  18. Then you should set it in process.php. It should look something like this: setcookie("user", $_POST['name'], time()+3600); So when you submit to process.php you get the text field for the name they typed in. Keep in mind time()+3600 is in seconds. So 3600 = 1 hour. You should modify if you want the cookie to last longer.
  19. It works... as far as functionality. Doesn't look pretty, the pop-up is annoying, and so is the fact that I have to hit the back button to do another calculation.
  20. You would do something like this. if (isset($_COOKIE["user"])) { $user_name = $_COOKIE["user"]; } else { $user_name = "Guest"; } ?> </pre> <form name="myform" action="process.php" method="POST"> First Name: < You also have to set the cookie somewhere, (maybe after the user logs in), by doing: setcookie("user", "name_here", time()+3600); Try it and come back with specific questions.
  21. Probably because the browser you were using, like most browsers, don't automatically re-submit your data due to security precautions.
  22. I was Googling around and found this script for you. It's a bit lengthy but it seems to work. <br /> <!--<br /> var os, ua = navigator.userAgent;<br /> if (ua.match(/Win(dows )?NT 6\.0/)) {<br /> os = "Windows Vista"; // Windows Vista ???<br /> }<br /> else if (ua.match(/Win(dows )?NT 5\.2/)) {<br /> os = "Windows Server 2003"; // Windows Server 2003 ???<br /> }<br /> else if (ua.match(/Win(dows )?(NT 5\.1|XP)/)) {<br /> os = "Windows XP"; // Windows XP ???<br /> }<br /> else if (ua.match(/Win(dows)? (9x 4\.90|ME)/)) {<br /> os = "Windows ME"; // Windows ME ???<br /> }<br /> else if (ua.match(/Win(dows )?(NT 5\.0|2000)/)) {<br /> os = "Windows 2000"; // Windows 2000 ???<br /> }<br /> else if (ua.match(/Win(dows )?98/)) {<br /> os = "Windows 98"; // Windows 98 ???<br /> }<br /> else if (ua.match(/Win(dows )?NT( 4\.0)?/)) {<br /> os = "Windows NT"; // Windows NT ???<br /> }<br /> else if (ua.match(/Win(dows )?95/)) {<br /> os = "Windows 95"; // Windows 95 ???<br /> }<br /> else if (ua.match(/Mac|PPC/)) {<br /> os = "Mac OS"; // Macintosh ???<br /> }<br /> else if (ua.match(/Linux/)) {<br /> os = "Linux"; // Linux ???<br /> }<br /> else if (ua.match(/(Free|Net|Open)BSD/)) {<br /> os = RegExp.$1 + "BSD"; // BSD ????<br /> }<br /> else if (ua.match(/SunOS/)) {<br /> os = "Solaris"; // Solaris ???<br /> }<br /> else {<br /> os = "N/A"; // ???? OS ???<br /> }<br /> document.write(os);<br /> // --><br />
  23. I don't see any submit button in your code. If you have another question I suggest you create a new thread with all the relevant code.
  24. NO! Never post ALL of the code... we never need to see it all. Why wouldn't you want to see all the RELEVANT code? I agree with not all the code, even though a lot of people do that, although it is better than no code.
×
×
  • 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.