AyKay47
Members-
Posts
3,281 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AyKay47
-
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']);
-
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....
-
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
-
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
-
you can feed them to one file and still have them asynchronous..depends on how you are going about it.
-
Errors are not logging to errors.log
AyKay47 replied to hmdnawaz's topic in PHP Installation and Configuration
in you php.ini do you have display_errors set to ON? Also, make sure that your error reporting is set to 1 -
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..
-
that was a very interesting way of describing it....
-
preg_match returns two different results for same string
AyKay47 replied to mrgrammar's topic in PHP Coding Help
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 -
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
-
The uploading of entire directories/folders is a limitation of the upload capabilities of the browser, not PHP
-
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')">
-
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
-
the example that xyph gave you is a method called typehinting...look here for more info
-
why not make class2 extend class 1, then use parent::
-
change you query to mysql_query("SELECT * FROM `map` WHERE `x`=1 AND `y`=0") //remove parenthesis
-
if you are using the module version of PHP, you can also use phpinfo() for various names of extensions that PHP is compiled with
-
Warning: mysql_close(): 5 is not a valid MySQL-Link resource in
AyKay47 replied to MDanz's topic in MySQL Help
would need to see the rest of your code -
http://www.php.net/manual/en/book.session.php
-
can you post your code as well as a better description of what you are trying to accomplish please?
-
wrap your include in quotes include("$path/$file/descriptions.txt");
-
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
-
editted my previous post, please refer
-
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