Jump to content

AyKay47

Members
  • Posts

    3,281
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by AyKay47

  1. I would check to make sure that the user has clicked the submit button before parsing this. <?php if(isset($_POST['register'])){ if(!empty($_POST['username']) && !empty($_POST['password'])) { $username = mysql_real_escape_string($_POST['username']); $password = md5(mysql_real_escape_string($_POST['password'])); $email = mysql_real_escape_string($_POST['email']);
  2. your'e missing a parenthesis if(mysql_num_rows($checkusername) == 1) { echo "<h1>Error</h1>"; echo "<p>Sorry, that username is taken. Please go back and try again.</p>"; } Edit: hold on....
  3. first, on this line $limit_size='2097152'; by wrapping the number in quotes, you are treating it as a string, so therefore it will always pass your if statement regardless, remove the quotes $limit_size = 2097152; As far as your check for an empty name, if the user tries to upload a blank image, your code will simply store an error into a variable, not even echo the error, and wont hault the script which it should. elseif ($fileName1=="") {print "Please choose a file to upload"; $success=0; exit("failure!");} For number 3, the in_array() function should work to check for a valid file extension...I will need to look further at it
  4. first, using mysql_error() with the mail function accomplishes absolutely nothing. mail() has nothing to do with mysql... Can you re-post your code with is not being in URL format please
  5. you can feed them to one file and still have them asynchronous..depends on how you are going about it.
  6. in you php.ini do you have display_errors set to ON? Also, make sure that your error reporting is set to 1
  7. this thread talks about the issue http://ubuntuforums.org/showthread.php?t=276470
  8. that was a very defensive response to a playful post....geeze man lighten up.. and namespace polution would not make much sense to use here now would it..
  9. that was a very interesting way of describing it....
  10. firstly, you wont need to treat the user input until it passes your preg_match anyway. Treating it before-hand is extra work that is not needed. Also, if you pasted that code from your text editor, you are missing your quotes around your index. $data = $_POST['forminput']; //added quotes $data = strip_tags(htmlspecialchars(mysql_real_escape_string($data))); //not needed $checkdata = preg_match("/[\r\n]/",$data); // output: $checkdata = false
  11. global is used to create a reference in local scope to a variable that is in the global scope...classes work differently, they are both in the classes scope
  12. The uploading of entire directories/folders is a limitation of the upload capabilities of the browser, not PHP
  13. you can use the "onunload" javascript event to detect when a user is leaving your site, when the onunload event is triggered, you can trigger a function to create your popup. <head> <script type="text/javascript"> function popUp(url) { popup = window.open(url,"name","height=300,width=200"); if(window.focus) {popup.focus()} return false; } </script> </head> <body onunload="popUp('popup.hmtl')">
  14. since you have already done most of the work, I won't insult your inteligence by stating the obvious ways to do numbers 1 and 3 on your list. to upload the images to a certain directory, you will want to use the move_uploaded_file() function
  15. the example that xyph gave you is a method called typehinting...look here for more info
  16. why not make class2 extend class 1, then use parent::
  17. change you query to mysql_query("SELECT * FROM `map` WHERE `x`=1 AND `y`=0") //remove parenthesis
  18. if you are using the module version of PHP, you can also use phpinfo() for various names of extensions that PHP is compiled with
  19. would need to see the rest of your code
  20. http://www.php.net/manual/en/book.session.php
  21. can you post your code as well as a better description of what you are trying to accomplish please?
  22. wrap your include in quotes include("$path/$file/descriptions.txt");
  23. php freaks has a thread that they would like users to read before posting header errors...should clear this matter up http://www.phpfreaks.com/forums/index.php?topic=37442.0
  24. editted my previous post, please refer
  25. you are misunderstanding, but its okay here's what you would want <?php $host = " "; $username = " "; $password = " "; $tbl_name = "users"; $db = mysql_connect($host, $username, $password) or die("Could not connect: " . mysql_error()); mysql_select_db("photo_artists"); ?> also, you will need to fill in the $host $username and $password information with the valid information for your server unless they are not set
×
×
  • 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.