![]() |
First question:
I have created a mail form and was wondering how to get the action to be home2.php?page=mail&action=results. I already have the form as home2.php?page=mail. Second question: I have also created a news posting script that saves to a file named home.inc and was wondering how I can get the information to display from newest to oldest, instead of oldest to newest. The information that is written to home.inc looks like this: :
$output = '<h2 class=/"margin/">'.$date.'</h2>\n<p class=/"margin/">'.$post_content.'</p>';Any help is greatly appreciated. Thank you in advance. |
The easiest method is just to write new data to the front of the file.. which means everytime you want to write to a file, write to a temporary file, copy the old news file the the end of the temp file, then move the temp file to the original file's place.
In your form try using: <input type="hidden" name="action" value="results"> That is the simplest way to do it, and I am assuming will work for your purposes.. if not come back and be a bit more precise on telling us how you plan on generating that URI ;) |
Here's a little diddy, that i whiped up...havn't tested it though.
get you script that inputs the news into the file to seperate the news with a line that contains somthing like ^&. :
<?PHPAnyways, That's how i would do it, but kurifu is right Quote:
Good luck and hope my code is right...heh |
| All times are GMT -5. The time now is 8:01 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC