Jump to content

help, how would i do this; 2


Minimeallolla

Recommended Posts

ok so now that the submit button is clicked, it stores $content into the file that we wanted. thats all good and everytihng, now i want to echo that files content. and replace the whole content with the new $content everytime, if you know what i mean..?

if (isset($_POST['submit'])) { 
$firstname = ($_POST['firstname']);
$lastname = ($_POST['lastname']);
include ("cookieusername.php");

$check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error()); 
while($info = mysql_fetch_array( $check )) 
$filename = "/home/bob/public_html/mysite/profiles/profileinfo/$username.info.php" or exit("Unable to open file!");
$handle = fopen($filename, 'a+')or die; 
$content = "$firstname";
fwrite($handle, $content)or die; 
fclose($handle);
}

Link to comment
https://forums.phpfreaks.com/topic/218381-help-how-would-i-do-this-2/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.