Jump to content

redarrow

Members
  • Posts

    7,306
  • Joined

  • Last visited

Everything posted by redarrow

  1. Also when uploading a file. make sure the file exstention, is correct and not a .exe and others. Always only let registred users upload files only. Your be amazed, off hacks for files. There even talk images, with code written on top of the image, to do spitefull things... seen no example yet.
  2. what about. <?php $filename = $username; if (file_exists($filename)) { die(); } ?>
  3. This was to match two letters together, 1 was from a post / form,another from a array. it working this way but in_array wouldnt work ... Please can you give an example of in_array, matching a posted letter and a array letter cheers. <?php if(isset($_POST['submit'])){ $quostionb=array("a"); $quostiona=$_POST['quostiona']; if(strstr($quostiona,implode($quostionb," "))){ echo"<p> ansaw is: ".implode($quostionb," ")." "; }else die(); } ?> <form method="POST" action=" "> <select name="quostiona"> <option value="a">a</option> <option value="b">b</option> </select> <input type="submit" name="submit" value="send"> </form>
  4. this is to insucure , pretty sure there a better way?
  5. You got the database setup incorrectly then. your need to post the id as a varchar in the database feild. mysql wont do it for you. it will make a primary key as one field as you no, but afther that you controll all inserts.
  6. can we see code... preg_replace i am sure. show a example please off code
  7. You need to leard mysql properly, There loads off ways to acheve this. it very basic. http://www.tizag.com/mysqlTutorial/mysqlsyntax.php please use this web site, to learn mysql select statement. this page might help you http://www.tizag.com/mysqlTutorial/mysqlwhere.php It not i dont want to help you, but you ask and ask, but with no example of work, makes me think, are u getting us to do your home work. your asking me to help you with no written text from you self, so are you learning php,mysql or just copying? Your asking as if you havent studied. There a forum part that let you hire a php programmer if ur not studying php.
  8. Little example with a hidden field. It all static so you understand it. <?php $members_id="001"; $amount_money="£10.00"; if($_POST['submit']){ $ansaw=$_POST['ansaw']; if($members_id=="001" && $ansaw=="Yes" ){ echo "<center> Your id is: $members_id <br> You currently owe us $amount_money but your ansaw was $ansaw <br /> <br /> </center>"; } if($members_id=="001" && $ansaw=="No" ){ echo "<center> Your id is: $members_id <br> You no you owe us $amount_money please pay immediately! <br /> <br /> </center>"; } } ?> <?php echo"<center> Did you pay us, the full amount off money!. <br /> <br /></center>"; ?> <center> <form method="POST" action="form.php"> <select name="ansaw"> <option value="Yes">Yes</option> <option value="No">No</option> <input type="hidden" name="members_id"> </select> <br /> <br /> <input type="submit" name="submit" value="SEND"> </form> </center>
  9. google maps got nothink to do with php http://www.crearedesign.co.uk/blog/web-design/google-maps-api-tutorial.html please goto the creters of google maps, and learn there code it easy. hope this helps. google a grate friend off mine , and i can read.
  10. How can that happen, when each new page visitor, get's a new session for them only. old session is gone / deleted. not unless you got all session's in a database? and database is insecure...
  11. Most people coming from another programming language like using the class format of php, predefined programming in php can also be fast. Both can be written, to do the same thing, in a class format or predefined format. Predefined programming for a absolute beginner, is easer to understand. Saying that each individual are different at there ability to program php code. example I might be good at class never programmed in my life. Try them both is the an saw. Saying even that, Your have to learn all the php commands and there all predefined as examples any way. Most programmers use the php.net manual daily,hourly, to learn examples of php and unfortunately you get the examples in predefined examples from php.net. i personally only use a class when selling a project , only for simplicity only ((not speed or tidiness)).
  12. Code corrected and understood why.... from the previous attempt, I didn't use a array, i used a assoc, so it went wrong, also I wrote the select statement wrong. also i didn't select the database name (from mysql) working <?php //database connection. $DB = mysql_connect("localhost","root") or die(mysql_error()); if($DB){ //database name. $DB_NAME="mysql"; //select database and name. $CON=mysql_select_db($DB_NAME,$DB)or die(mysql_error()."\nPlease change database name"); // if connection. }if($CON){ //show tables. $mysql_show="SHOW TABLES FROM $DB_NAME"; //select show and show. $mysql_select2=mysql_query($mysql_show) or die(mysql_error()); } //if allowed to show. if($mysql_select2){ //while it and while($data=mysql_fetch_array($mysql_select2)){ //show it. echo " $data[0] <BR>"; } } ?> not working.(with my mistakes)))) <?php //database connection. $DB = mysql_connect("localhost","root") or die(mysql_error()); if($DB){ //database name. $DB_NAME="mysql"; //select database and name. $CON=mysql_select_db($DB_NAME,$DB)or die(mysql_error()."\nPlease change database name"); // if connection. }if($CON){ //show tables. $mysql_show="SHOW TABLES"; //select show and show. $mysql_select2="mysql_query(".$mysql_show.") or die(mysql_error())"; } //if allowed to show. if($mysql_select2){ //while it and while($data=mysql_fetch_assoc($mysql_select2)){ //show it. echo $data; } } ?>
  13. Had to be done this way, with a array. <?php $DB = mysql_connect("localhost","root") or die(mysql_error()); //database name. $DB_NAME="mysql"; //selEct database and name. $CON=mysql_select_db($DB_NAME,$DB)or die(mysql_error()."\nPlease chage database name"); $showtablequery = "SHOW TABLES FROM mysql"; $showtablequery_result = mysql_query($showtablequery); while($showtablerow = mysql_fetch_array($showtablequery_result)) { echo $showtablerow[0]."<br />"; } ?>
  14. Advance thank you. Can you help please. The error..... Warning: mysql_fetch_assoc() expects parameter 1 to be resource, string given in C:\wamp\www\test_dabase.php on line 24 code. <?php //database connection. $DB = mysql_connect("localhost","root") or die(mysql_error()); if($DB){ //database name. $DB_NAME="mysql"; //select database and name. $CON=mysql_select_db($DB_NAME,$DB)or die(mysql_error()."\nPlease change database name"); // if connection. }if($CON){ //show tables. $mysql_show="SHOW TABLES"; //select show and show. $mysql_select2="mysql_query(".$mysql_show.") or die(mysql_error())"; } //if allowed to show. if($mysql_select2){ //while it and while($data=mysql_fetch_assoc($mysql_select2)){ //show it. echo $data; } } ?>
  15. insert_id http://php.net/manual/en/function.mysql-insert-id.php Can make this really easy, just add a time stamp to the database column. paul the info out with the last data and time
  16. preg_replace();
  17. imposable to answer, unless we see the code... cheek all user input, cheek all input,cheek again....
  18. preg match .(cheek all characters and there order. http://php.net/manual/en/function.preg-match.php
  19. where that written, i do it that way???? (i do use a primary key thu.
  20. It can be done, but it not a good idea. It involves a lot of javascript, but it so insecure. Send a link as advised. you could do better, idea.... send a link to user email account , they press the link and it, cheeks there id info on your database, then redirect to a page they can see the info only on your server not there email account.
  21. arabic way... example short <html dir="rtl"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <head> </head> <body> Submitted </body> </html> read the header section mate http://php.net/manual/en/function.mail.php
  22. select distinct sponsor from table ORDER BY sponsor ASC mysql should off done that, your code is correct, try with no ascending 1 min your hiding all the error's why... get rid off the @, your a coder know... what not broke leave alone, if broke fix it also <?php <<correct way. sometimes short cuts make scripts not work, even if function is enabled....
  23. learn gd better off... http://php.net/manual/en/book.image.php
  24. is the $_SESSION['username'] working.... there no code mistake.. unless you add <?php if($_POST['update']){ //all the code here to update the database....... } ?> Dont see nothing else wrong , is all the variable names correctly spell in the database have a look?
  25. Solved my own problem ill use a 3rd party software, using OCR ,to read the number plate, from a picture done.
×
×
  • 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.