Jump to content

ZulfadlyAshBurn

Members
  • Posts

    783
  • Joined

  • Last visited

Everything posted by ZulfadlyAshBurn

  1. Do you know the purpose of the function POST? its to get the variables from the input. you calling invalid input previously. <?php include('include/connection.inc'); $name = $_POST['fname']; $lname = $_POST['lname']; $age = $_POST['age']; $date = $_POST['date']; $time = $_POST['time']; $sql = mysql_query("SELECT * FROM table_1 WHERE date='$date' AND time='$time'"); if (mysql_num_rows($sql) != 1) { echo "booked"; } else { $sql2 = mysql_query("INSERT INTO table_1 (name,lastname,age,date,time) VALUES ('$name','$lname','$age','$date','$time')"); } ?> this should work.
  2. show your form code.
  3. try this include('include/connection.inc'); $name = $_POST['name']; $lname = $_POST['lastname']; $date = $_POST['date']; $time = $_POST['time']; if (!mysql_num_rows($sql) == 1) {echo "booked";} else { $sql2; } $sql2 = mysql_query("INSERT INTO table_1 (name,lastname,age) VALUES ('$name','$lname','$age')"); $sql = mysql_query("SELECT * FROM table_1 WHERE date='$date' AND time='$time'; "); the codes makes no sense. you are not checking if it its booked. you are also not updating the database. your database table should look like this [ name | lastname | age | date | time ] make it like this then use this code. <?php include('include/connection.inc'); $name = $_POST['name']; $lname = $_POST['lastname']; $date = $_POST['date']; $time = $_POST['time']; $sql = mysql_query("SELECT * FROM table_1 WHERE date='$date' AND time='$time'"); if (mysql_num_rows($sql) != 1) { echo "booked"; } else { $sql2 = mysql_query("INSERT INTO table_1 (name,lastname,age,date,time) VALUES ('$name','$lname','$age','$date','$time')"); } ?> EDIT: just updated
  4. or you change the innerHTML of a div to an image when the user clicks upload.
  5. use ajax/jquery to run php and check if file exist on server else show loading.
  6. are you using ajax to upload the files? use ajax/jquery to run php and check if file exist on server else show loading?
  7. something like that.
  8. when users book that time range, update your database and say its booked. everytime someones tries to book, the script checks the database if the time range has been book. if book, echo error else echo booked.
  9. If you are trying to get data from IMDb page, its illegal unless you get written permission. You can create a movie info stie but not exactly like IMDb. they have no copyright/trademark on the layout of the page.
  10. You should validate your data on the same page using javascript or through ajax and prevent default for submit
  11. Then maybe you are not qualified for the job? Do you have enough experience to get into that particular company? Why not choose other job
  12. If you were using xp,i could have guided you
  13. You should use lesser than nine cause lesser than eight does not include eight. Edit: this is because you want the max length to be 8 and not7
  14. for your password input set the max length. <input type="password" id="password" name="password" maxlength="8"/> <input type="password" id="password1" name="password1" maxlength="8"/>
  15. OP trust this guy. look into jQuery API if you wish its pretty simple to implement. what i posted is pretty basic.
  16. this is how it works using javascript <form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>"> How will you be sending your message?<br /> <input type = 'radio' name = 'method' id='text' value = 'text' onchange="check()"/> Text to mobile <input type = 'radio' name = 'method' id='email' onchange="check()" value = 'email' /> Email <br /> <div style='display:none' id='msg'> Enter your message below:<br /> <input type = 'text' id = 'message' name = 'message' maxlength = '185' /><br/> <input type='submit' value='submit'/> <br /> </div> </form> <script> var text = document.getElementById("text"); var email = document.getElementById("email"); function check() { if(text.checked){ document.getElementById("msg").style.display = "block"; } else { document.getElementById("msg").style.display = "none"; } } </script>
  17. its possible using javascript.
  18. do you get the error before submitting the data or after? i dont see any submit buttons. try this. <html> <head> <title>SMS System</title> </head> <body> <form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>"> <?php if(isset($_POST['method']) && !empty($_POST['method'])) { $selected_radio = $_POST['method']; } else { echo " How will you be sending your message?<br /> <input type = 'radio' name = 'method' value = 'text' checked = 'yes' /> Text to mobile <input type = 'radio' name = 'method' value = 'email' /> Email <br /> <input type='submit' value='submit'/> <br /> <br /> <br />"; } if($selected_radio == 'text'){ echo "Enter your message below:<br />"; echo "<input type = 'text' id = 'message' name = 'message' maxlength = '185' /><br/> <input type='submit' value='submit'/> <br /> "; } ?> </form> </body> </html>
  19. why no use this. <style> .sticky { position:fixed; bottom:0px; padding: 5px; } </style> <div class="sticky"> content </div> that way it would stay at the bottom no matter what.
  20. why not use str_replace?
  21. if you are requesting the info from a govt site, there are still chances you will get caught as they are monitored every hour. good luck.
  22. anything is possible. yes, that is very well possible. Use cron jobs. you would need to have access/written permission to the site which is holding the result, else it will be deem as illegal.
×
×
  • 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.