-
Posts
2,965 -
Joined
-
Last visited
Everything posted by mikesta707
-
[SOLVED] Weird MySQL error, why am I recieving this?
mikesta707 replied to MySQL_Narb's topic in PHP Coding Help
this is where the error is popping up right? $get = mysql_query("SELECT * FROM users"); while ($row = mysql_fetch_assoc($get)) that means that the query is failing. Put or die(mysql_error()) after that, and see what error you get -
try addslashes()
-
Undefined Variable: PHP_SELF, pls help
mikesta707 replied to cottonbuds2005's topic in PHP Coding Help
I noticed this print " <a href=\"$PHP_SELF?s=$prevs&q=$var\"><< $PHP_SELF should be $_SERVER['PHP_SELF'] -
I would just do somethink like Andy posted. Probably just use ajax to update their gold when they are logged on, then just update their gold when they log in
-
[SOLVED] General question about proper coding...
mikesta707 replied to galvin's topic in PHP Coding Help
If you are going to be distributing your code, then I would probably try to seperate your PHP and HTML, as a bunch of different opening and closing tags can make your code kind of confusing. However, if you are coding your own projects, than I would open/close your PHP tags as much as you want. Doing it too much can become confusing, but with a proper balance, you should be fine -
[SOLVED] Add zero to the hundredths place if needed
mikesta707 replied to tqla's topic in PHP Coding Help
look into number_format() -
oh well one thing. <input type=\"hidden\" name=\"player[]\" />" needs a value attribute for it to pass anything. you probably want to make it echo "<td><input type=\"hidden\" name=\"player[]\" value=\"" . $row["l_name"] . " " . $row["f_name"] . "\" />" . $row["l_name"] . " " . $row["f_name"] . "</td>\n";
-
http://www.phpfreaks.com/forums/index.php/topic,200925.0.html
-
notice something <!-- HERE --> <input type=\"hidden\" name=\"player[]\" />" //////////////////////HERE///////// $playerName = $_POST['name'][$key]; [/code]
-
that happens because you don't define either of those variables unless you submit the form, because of the following: if (isset($_POST['submit'])) why would you want to populate the form with something that would be empty anyways? just remove the <?php echo $username; ?> and <?php echo $fullname; ?> stuff. but one thing i noticed if (isset($_POST['submit'])) { $submit = $_POST['submit']; $fullname = strip_tags($_POST['fullname']); $username = strtolower(strip_tags($_POST['username'])); $password = strip_tags($_POST['password']); $repeatpassword = strip_tags($_POST['repeatpassword']); $date = ("date.America/New_York"); $email = $_POST['email']; {//this??? that opening curly brace doesn't seem to need to be there. Honestly, I'm surprised that you don't get a syntax error
-
ok.. yeah as I thougth you just copy pasted what I posted at the top of your code. this line if (isset($_POST['submit'])) was meant to replace this line if ($submit) since essentially they do the same thing, and this stuff, $submit = $_POST['submit']; $fullname = strip_tags($_POST['fullname']); $username = strtolower(strip_tags($_POST['username'])); $password = strip_tags($_POST['password']); $repeatpassword = strip_tags($_POST['repeatpassword']); $date = ("date.America/New_York"); $email = $_POST['email']; should go after the isset test: if (isset($_POST['submit'])) but if you want to fix your code the easy way, you seem to be missing a closing curly bracket at the end of your nested if/elses. just add one after this bit } else echo "Please fill in <b>all</b> fields"; } either way it will do the same thing so it doesn't matter much
-
what you did there is fine. Unexpected $end errors pop up usually when you are missing an ending curly bracket somewhere in your code. Try posting the whole script so I can take a look
-
thats probably because you took what I posted and just slapped it in the middle of your code, instead of changing your code to model what I posted. If i were to guess (and this is just a guess because you haven't posted your updated code) assuming you just copy pasted what I typed, you are missing the closing curly brace ('}') to end the if statement
-
[SOLVED] [URGENT]big header error...[/URGENT]
mikesta707 replied to Noskiw's topic in PHP Coding Help
that tells you where the output is started go to that line, and stop it from outputting stuff -
that happens because you try to set variables to POST data that doesn't exist yet. you should do something like if (isset($_POST['submit'])){ $submit = $_POST['submit']; $fullname = strip_tags($_POST['fullname']); $username = strtolower(strip_tags($_POST['username'])); $password = strip_tags($_POST['password']); $repeatpassword = strip_tags($_POST['repeatpassword']); $date = ("date.America/New_York"); $email = $_POST['email']; //etc. What happens is you try to access the $_POST array with indexs that don't exist yet. Which is why the error says undefined index
-
http://www.geekpedia.com/code54_Drop-down-list-of-countries.html google is your friend...
-
like I said, you should us javascript and PHP validation. Javascript validation is more or less bells and whistles as (as you have no doubt noticed) it can be turned off, whereas PHP cannot. Its nice to have the javascript validation, but its not fool proof. As for opening a new blank page, remember, doing things with the browser (like popups, opening new windows) can only be done by the client. PHP is executed on the server, and because of that it can't do much with the browser besides detect that kind of browser it is. Any kind of popup that happens is generally javascript
-
How to open a web page already scrolled down a bit
mikesta707 replied to php_beginner_83's topic in PHP Coding Help
to make a link go to an anchor just add the pound sign plus the name of the anchor to the end of the link. for example <a href=photoGallery.php?ID=$ID#anchor> you could also use javascript I guess... but that may be unnecessary because as Matt said it depends on screen resolution and all that. although I suppose you could use Javascript to detect the resolution of a user, and respond accordingly -
if you want pop ups, only javascript can do that (its a client side thing.) You can have a required field, but in order for you to have a "dynamic" one (IE one that won't let you submit the form without filling out the correct text fields) you need javascript for that also . Remember, PHP is parsed on the server, so after the page is loaded, PHP can t do anything. In PHP you can do something like if (!isset($_POST['required']) || empty($_POST['required']){ echo "You didnt fill out a required filed"; } If I were you, I would implement the javascript validation, but remember to implement a PHP validation just incase someone doesn't have javascript enabled. Most people don't disable javascript, so you won't need to worry about it for the most part, but you always want the PHP validation to fall back on
-
How to open a web page already scrolled down a bit
mikesta707 replied to php_beginner_83's topic in PHP Coding Help
you can create an HTML anchor <a name="#scrollHere"> but you would then have to add that to your link, IE <!-- normal link --> <a href="link.php">link</a> <!-- anchor link --> <a href="link.php#scrollHere">link</a> -
can I see your code?
-
[SOLVED] Check a string for certain character
mikesta707 replied to salman_ahad@yahoo.com's topic in PHP Coding Help
str_replace('"', "", $string);