Jump to content

JasonLewis

Members
  • Posts

    3,347
  • Joined

  • Last visited

Everything posted by JasonLewis

  1. i am not sure if this will work. but i have never had anything like this. you have a ; after the if statement. try taking that away. so it would be this: [code] <?php if(isset($_POST['submit'])){ echo "This seems to work" } ?> [/code] now the $_SERVER['PHP_SELF'] bit. Are you supposed to echo that bit and not the $_POST['a']=add_entry. Because your closing the line with the ; so maybe try echoing the $_SERVER['PHP_SELF']; Hope i helped.
  2. it has to be $_SERVER['REMOTE_ADDR']; because it is a predefined variable. Are you sure it isnt working with that?
  3. you have to use the mail() function. check out http://www.php.net/mail < i think thats the link
  4. the method is correct. i am pretty sure. so ur 100% sure its not assigning the error text to $ccString. did u try printing it. thats odd. i'll have a looky over.
  5. lol. soz i didnt c that. and with mine they dont have to go to a site. :D i'll look next time. sorry.
  6. if you want the users ip u have to use: [code]$ip = $_SERVER['REMOTE_ADDR'];[/code] i think thats there IP. if u want were they were refered from: [code]$refer = $_SERVER['HTTP_REFERER'];[/code]
  7. or if you want to put output simply put this at the top of your code then at the bottom: [code] ob_start(); <--- CODE ---> ob_end_flush(); [/code]
  8. yes but some ppl dont like putting the query straight into mysql_query. i used to do it. ur way is just neater, well its my way as well. but i use OOP so mine would be $DB->query
  9. only because it re-directs without loading the page first. depends what he wants, but that is better.
  10. if i were u i would re-write this as this. [code] $userid = $_GET['user']; if($userid) { $sql  = "SELECT * FROM `style` WHERE `user_id`='".$userid."'"; //Put all this in one line and add the ` and the ' $result = mysql_query($sql) or die (mysql_error()); if(mysql_num_rows($result) == 1) { $row = mysql_fetch_array($result); [/code] try it. c if it works
  11. you have to use the mktime() function. try this: [code] $next_breed = date('Y/m/d', mktime(0, 0, 0, date('m'), date('d')+7, date('Y')); [/code] i aint sure though, i havnt used it very often.
  12. from just looking at the php code. try replaceing it with this. but i am not sure because you didn't give any errors. but just try this: [code] <?php $con = mysql_connect("","dropdown",""); if (!$con)   {   die('Could not connect: ' . mysql_error());   }mysql_select_db("dropdown", $con); $firstname = $_POST['firstname'] ; $sql="INSERT INTO `buttons` (`one`) VALUES ('".$_POST['firstname']."')"; if (!mysql_query($sql,$con))   {   die('Error: ' . mysql_error());   } echo "1 record added";mysql_close($con) ?> [/code]
  13. try this: [code] <meta http-equiv="refresh" content="0;url=http://zycoworld.com/<?php echo $_GET['user']; ?>"> [/code] you didnt echo it. so its just a blank php code pretty much.
  14. you should have to put [code]$db=mysql_select_db($database, $connect);[/code] you can just put: [code]mysql_select_db($database, $connect);[/code] and when using mysql_close you dont have to specify the link identifier. it can simply be: [code]mysql_close();[/code] and it will close the last open connection.
  15. do you have to use DOCTYPE? in all my websites i never used doctype. you could try <br /> but i dunno.
  16. are you saying you want to use a script that creates a yahoo account without going there? by accessing there dbs etc. thats just crazy.
  17. ok. first off. what the others said is correct. {Comments} would be a variable. so you would do: [code]$comments = nl2br($comments);[/code] or you could do this, but its easier to do the above: [code]$comments = str_replace("\n", "<br>", $comments);[/code]
  18. first of all i would make it so they must enter the username and search for the user first. then on the next page retrieve the variables for the database. so get like the variable Air and the variable Dark from the database. Then you can just use some simple if commands like so: [code] Dark: <?php if($dark == "1"){ ?> <input type="checkbox" name="ud_dark" value="$dark" selected> <?php }else{ ?> <input type="checkbox" name="ud_dark" value="$dark"> <?php } ?> [/code] that should work pretty good i think. lol. [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] its just that you would have to do that for every checkbox. and there is probably an easier way but that way i showed works. good luck with your game. ProjectFear
  19. hey to make it easier with echoing you can go like this: [code] <?php echo <<<html Show the text in here! html; ?> [/code] or you can do it through a variable: [code] <?php $content = <<<html This is the top bit html; if(session_is_registered("member")){ $content .= <<<html //You put the . to add extra to the variable Welcome member! html; } echo $content; ?> [/code] Either is effective, but i use the variable.
  20. ok thanks, i'll give it a go and update this when i have finished. hopefully it works. EDIT: omg, thanks so much barand it worked. i'll remember this... thanks to everyone else as well! :)
  21. the score column is a 'varchar' field. would that have anything to do with it?
  22. this is the code that is inserting into the table. i am getting the score from flash, which is all working properly. here is the code that inserts it: $insert = "INSERT INTO `arcade` (`game_id`, `player`, `score`, `date`) VALUES ('$game_id', '$player', '$score', NOW())"; $result = mysql_query($insert); and Yesideez, how your doing it is pretty much exactly the same except mine is in a table. anyone? i need this fixed? thanks!
  23. [!--quoteo(post=367780:date=Apr 24 2006, 06:58 AM:name=ypirc)--][div class=\'quotetop\']QUOTE(ypirc @ Apr 24 2006, 06:58 AM) [snapback]367780[/snapback][/div][div class=\'quotemain\'][!--quotec--] Give us sample data, expected output, and the query you are currently using that is giving you unexpected output. [/quote] ok. sorry... well here is the query that i am running: $query = mysql_query("SELECT * FROM `arcade` WHERE `game_id`='$game_id' ORDER BY `score`"); this is what it is showing: Rank Member Score Date 1 The One 860 23 April 2006 2 The One 57 23 April 2006 3 saiko 365 23 April 2006 this is what it should be showing: Rank Member Score Date 1 The One 860 23 April 2006 2 saiko 365 23 April 2006 3 The One 57 23 April 2006 but for some reasona s u can c above it is grouping the usernames first, then it orders the score!!! anybody have any ideas?
  24. Hey there! My first topic. Anyway... i have a member system, which is nearly complete and its kickass. but thats not the point. i have been killing myself over the arcade for members. when i get the scores i am sorting it by the score from highest to lowest... but the thing is that it does that, but it does it by the username of the member first. When i insert the data into the table i have a field for the game id, a field for the username, and field for the score and a field for the date. (i also have id so i can delete later on if i want to). now it sorts by the score but it groups the usernames together... WHY IS IT DOING THIS!!!!???? please help someone cuz its really annoying... thankyou in advance!
×
×
  • 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.