Forum Moderators: coopster
So if the number is 50 it will add 1 to that equaling 51 and then if another person does presses the submit button it goes from 51 to 52.
Is there anyway to do this? and if so can you show me how?
<?
$name = $_POST['name'];
$center="<br><center>";
$ecenter="</center>";
$header="";
$bottom="";
if(isset($name, $gamename, $contact, $code1, $code2, $code3, $country, $card, $bio)) {
$fp = fopen("/home/www/poketech.net/site/wi-fi/users/$current_count.php","a");
?><?
echo "<br><center>Your page is here: <a href=/site/wi-fi/users/$current_count.php>http://example.net/site/wi-fi/users/$current_count.php</a></center>";
?>
<?
echo "$count";
?>
<?
fputs($fp,($header).'<?PHP include("/home/www/example.com/top.php");?>');
fputs($fp,nl2br($center).'<table border="1"><tr><td>Username:</td><td>');
fputs($fp,nl2br($name).'</td></tr><tr><td>Game Name:</td><td>');
fputs($fp,nl2br($gamename).'</td></tr><tr><td>Contact:</td><td>');
fputs($fp,nl2br($contact).'</td></tr><tr><td>Friend Code:</td><td>');
fputs($fp,nl2br($code1).'-');
fputs($fp,nl2br($code2).'-');
fputs($fp,nl2br($code3).'</td></tr><tr><td>Country:</td><td>');
fputs($fp,nl2br($country).'</td></tr><tr><td>Trainer Card:</td><td><img src="');
fputs($fp,nl2br($card).'"></td></tr><tr><td>Bio:</td><td>');
fputs($fp,nl2br($bio).'</td></tr></table>');
fputs($fp,nl2br($ecenter).'');
fputs($fp,($bottom).'<?PHP
include("/home/www/example.com/bottom.php");?>');
fclose($fp);
}
?>
I have a page called add.php and then this is where everything takes place in the process.php, so the visitor fills out the form and it creates a page in the "/users/" directory but then I want it to have a number in the url so like "http://example.net/site/wi-fi/users/1.php" and then the next visitor that makes a page it will have and url like this "http://example.net/site/wi-fi/users/2.php" so it adds one each time. But I couldn't get it to work so that it would add 1 to it each time...
Any suggestions on how to do that? Or you can just fix the code above.
[edited by: PokeTech at 11:02 pm (utc) on Feb. 2, 2008]
[edited by: eelixduppy at 6:39 am (utc) on Feb. 3, 2008]
[edit reason] please use example.com [/edit]
user_id is the result of a query on user's table and inserted in the new table (you might at some point need it!)
page address: aaaaaa.com
Sysytem: query the new table grab the last page id
then
the final address to insert will be a concataination [w3schools.com] of page_address and page_id+1
$end=$page_id+1;
$new_address=$page_address.$end;