Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by robert_gsfame

  1. at the top of your page put <?php session_start(); ?> then never put the header() in the <body> so put everything at the top of your php page so it goes like this <?php session_start(); ?> <?php if($_POST['submit']) { if(!empty($_POST['textbox'])) { header("Location:page2.php"); } } ?> <html> <head> <body> <form name=form1 method="post" action="<?php echo $_SERVER['PHP_SELF'];?>"> <input type="text" name="textbox"> <input type="submit" name="submit"> </form> </body> </head> </html> IT WILL WORK 100%
  2. then u can use <form action="<?php echo $_SERVER['PHP_SELF'];?>"> then u can validate every single input and put it at the top of your page eg: if($_POST['submit']) { if(!empty($_POST['text'])) { header("Location:page2.php"); } } so no submission when $_POST['text'] is empty
  3. i dont really get what you really want but as far as i notice If you are going to use $_POST['radio'] then you have to put your radio inside <form></form> and the another thing is that you can try to fill the form action with this <form action="<?php echo $_SERVER['PHP_SELF'];?>"> hope it helps
  4. What error shown up?? $abc =sprintf("INSERT INTO my_db1 (username, password, firstname, company, email) VALUES ('%s', '%s', '%s', '%s', '%s'", mysql_real_escape_string($username), mysql_real_escape_string($password), mysql_real_escape_string($surname), mysql_real_escape_string($firstname), mysql_real_escape_string($company), mysql_real_escape_string($email))); $resultg = mysql_query($abc); this is what i notice...try this $abc =sprintf("INSERT INTO my_db1 (username, password, firstname, company, email) VALUES ('%s', '%s', '%s', '%s', '%s')", mysql_real_escape_string($username), mysql_real_escape_string($password), mysql_real_escape_string($surname), mysql_real_escape_string($firstname), mysql_real_escape_string($company), mysql_real_escape_string($email)); $resultg = mysql_query($abc); surely it works!
  5. I have 2 frames just assume A and B And when i click on whatever records shown in frame A, i send it to another frame which frame B to display the detail of the record..currently i use <a href=blabla target=blabla> The problem is that i wish to load only the second frame without reload the whole page, so that it looks more professional and user friendly. How can i do this? can anyone give me an idea, logically thx
  6. Case like yours, you probably should use LIKE so instead of shoeName REGEXP '.*($getSearch).*' u can use shoeName LIKE '%$getsearch%' but if you still wish to use REGEXP, you can try this shoeName REGEXP '[[:<:]]".$getsearch."[[:>:]]'=1 100% must work! hope that helps
  7. I just want to ask the logic of making a chatroom. Is it correct if i prepare a table in MYSQL, php script to submit whatever words typed and use AJAX to refresh every second to be sure that all input displayed thx
  8. yup..i notice this $findpostcode1=mysql_query("SELECT users.branch1, branch.id, FROM users, branch WHERE users.branch1=branch.id"); if you wish to join two tables then this is the format $query=mysql_query("SELECT table1.* FROM table1 JOIN table2 ON table1.user_id=table2.user_id WHERE table1.column='blablabla'"); here is the explanation "SELECT table1.*" - If you wish to get the whole records from table1 "table1 JOIN table2" - You join both tables table1 and table2 "ON table1.user_id=table2.user_id" - if both tables have user_id and you wish to connect both tables based on user_id "WHERE table1.column='blablabla" is the condition you wish to have. Hope that helps
  9. hi, i am new to AJAX and i have problems when cope with query. How can i insert a record into database <script type="text/javascript"> function addcontact(str) { if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET","page2.php?id="+str); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("ajaxpage").innerHTML=xmlhttp.responseText; }else{ document.getElementById("ajaxpage").innerHTML="<img src=loading.gif>";} } xmlhttp.send(); } </script> here is the html code <a href=javascript:void(0) onclick=addcontact('123')>add Contact</a> i wish to pass the value of 123 using $_GET to page2.php. in page2.php, it will execute the INSERT query and change the <a href=javascript:void(0) onclick=addcontact('123')>add Contact</a> into "Your contact has been added successfully" thx
  10. dont get what you mean..are you going to send some bulk email to your enemy, arent you?
  11. okay lets try this way instead of having this <textarea class="padform" name="address" cols="40" rows="15" id="address" tabindex="5"/> change the order into this <textarea name="address" id="address" cols="40" rows="15" tabindex="5" class="padform"/>
  12. or die ('Unable to connect with Alumni Database. Try again later.); i Guess u miss another single quote or die ('Unable to connect with Alumni Database. Try again later.');
  13. <textarea class="padform"name="address" cols="40" rows="15" id="address" tabindex="5"/> move that name a bit <textarea class="padform" name="address" cols="40" rows="15" id="address" tabindex="5"/>
  14. if($_POST['submit']=="true") have u tried if(isset($_POST['submit'])) ??
  15. If i am not wrong, you must set mob column NOT NULL this might be the problem, you are not correctly insert the record $mobile=$_POST['mob']; VALUES('$name','$address','$UCAS','$tel','$email','$mob' see the bold one
  16. Incorrect integer value: '' for column 'ID' at row 1 Did u set ID column as autoincrement INT?? if yes then you have to modify the query and specify each column INSERT INTO UCASinterviews(name,address,address,UCAS,telephone,email,mobile,subject,interviewdate,interviewtime)VALUES ('$name','$address','$UCAS','$tel','$email','$mob','$subject','$interviewdate','$interviewtime','$parents'); hope that will solve the problem
  17. nope...i have 2 frames. frame1 = assume page1.php frame2= assume page2.php i run a script so that frame2 will do like page2.php =>page3.php=>page2.php during the process of redirection using header() i wish to refresh page1.php which is in frame1
  18. as long as it teaches you step by step. but to be an expert like people here will take time .
  19. I have 2 frames and let say i have run certain script on frame1 and it redirect me to other page (execute script) and back again to frame1. What i want to ask is how can i refresh the other frame which is frame 2 once header() has been executed. Thx..
  20. I have created a frameset but i dont know how to change the whole page into another page assume page5.html.... <frameset rows="26%,*" > <frame src="page1.html"> <frameset cols="30%,70%"> <frame src="page2.html"> <frame src="page3.html"> </frameset> thx
  21. but the problem is that one of the page is pure php script only. so no html tag at all
  22. I have this <body bgcolor="brown"> i wish to change bgcolor into white once print button being clicked window.print() how can i do that?? thx
  23. So it should be mysql_query("INSERT INTO reservation_items(reservationID,productID,productQuantity) VALUES('$theReservationID','$itno','$quant')");
  • 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.