Jump to content

mikesta707

Staff Alumni
  • Posts

    2,965
  • Joined

  • Last visited

Everything posted by mikesta707

  1. 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
  2. try addslashes()
  3. I noticed this print " <a href=\"$PHP_SELF?s=$prevs&q=$var\"><< $PHP_SELF should be $_SERVER['PHP_SELF']
  4. 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
  5. 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
  6. look into number_format()
  7. 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";
  8. http://www.phpfreaks.com/forums/index.php/topic,200925.0.html
  9. notice something <!-- HERE --> <input type=\"hidden\" name=\"player[]\" />" //////////////////////HERE///////// $playerName = $_POST['name'][$key]; [/code]
  10. 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
  11. 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
  12. 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
  13. 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
  14. that tells you where the output is started go to that line, and stop it from outputting stuff
  15. 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
  16. you can mark the topic as solved by clicking the topic solved button at the bottom of the thread
  17. http://www.geekpedia.com/code54_Drop-down-list-of-countries.html google is your friend...
  18. 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
  19. 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
  20. 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
  21. 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>
  22. can I see your code?
  23. str_replace('"', "", $string);
  24. haha it happens. You can mark the topic as solved by clicking the solved button at the bottom of the threads
×
×
  • 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.