Jump to content

interpim

Members
  • Posts

    303
  • Joined

  • Last visited

    Never

Everything posted by interpim

  1. on second thought... that won't work :/ far as I know, the script will want to finish before it outputs anything to the browser.
  2. maybe nest a while statement within a while... have one inside write each line, while the outside while cycle through the database?
  3. try using different forms with seperate actions for each button... Looks to me like you have several buttons in 1 form, essentially doing whatever action that form is telling it.
  4. <?php echo $_SERVER["REMOTE_ADDR"]; ?> I google searched "display ip address in php"... first result had the answer.
  5. you want to look into Pagination... here is a tutorial on how to do this... http://www.phpfreaks.com/tutorial_cat/25/Page-Number--Pagination.php
  6. $filename=$user . ".txt"; fopen($filename) will create a file if it doesn't exist... if you read up on this stuff http://us3.php.net/fopen you can get a lot more info on how to do this, for example what different methods you can use, and what happens with each different method.
  7. <?php $d=date("D"); if ($d=="Fri"){ echo "Have a nice weekend!"; }elseif ($d=="Sun"){ echo "Have a nice Sunday!"; }else{ echo "Have a nice day!"; } ?>
  8. $mytime=date()+25200; echo $mytime;
  9. try this <?php $newsheads = get_news_id(); $i = 0; while($i < count($newsheads)){ //output newsheads echo $newsheads[$i]."<br />"; $i++; } function get_news_id() { $conn = db_connect(); $result = $conn->query("SELECT newshead FROM news ORDER BY id desc LIMIT 5"); if (!$result){ throw new Exception('Could not execute query'); } $i=0; while($row = mysqli_fetch_array($result)) { $return[$i] = $row['newshead']; $i++; echo $return[$i]; } } ?>
  10. would this work? while(mysqli_fetch_assoc($result))
  11. reset the same cookie with empty strings.
  12. $url="http://url.com"; if(empty(file_get_contents($url)){ page isn't open; } else{ header("Location: $url"); } I may be wrong on the function to use... some of the more experienced folks around here can probably straighten me out LOL
  13. $_GET $_POST $_COOKIE , etc...
  14. build a function to pull the username from the session variable then echo that... call teh function wherever you want the username displayed
  15. you could give it a name... as long as it's unique you can search for it in the database via your query
  16. either way will work... different methods for each though
  17. you have to build it either in html, or use a loop to go through an array and write each one... either way your still going to have to write out all the states and the code for it...
  18. you would have to set an id variable based on that page... usually this is done with http://domain.com?page=123 you would then use the $_GET['page'] global array to grab the variable page. then you would use that to get the rest of the page from your DB.
  19. write one... If the files are stored in a DB, then create new fields for last updated/size etc... then when someone updates something have that script call your email function to get that info and mail it to you.
  20. <?php $index_id=$_GET['id']; //however your retrieving the data... be it GET or POST //connect to your DB... then query it with the $index_id variable $query="SELECT * FROM main WHERE index='$index_id'"; $result=mysql_query($query); //assign the content of the DB to variables $page_name=mysql_result($result,0,'page_name'); $content_1=mysql_result($result,0,'content_1'); $content_2=mysql_result($result,0,'content_2'); //print the variables and any html formatting you want to the screen. echo "<title>$page_name</title>"; echo "More code etc...."; echo "more stuff... "; ?>
  21. you want this forum http://www.phpfreaks.com/forums/index.php/board,58.0.html
  22. if (!isset $_POST['var']){ You didn't come by $_POST; }else{ You came by $_POST; }
×
×
  • 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.