Click to See Complete Forum and Search --> : PHP Automatic Client Updater?!?!


Immortal
11-29-2003, 09:44 AM
I am currently working on a php project. the project involves a basic form you fill out your name, the date, and whatever you want to write in 3 separate fields. Once you are done you click the Updae! button after this whatever you wrote should be sent to whatever page you are updating and it should be SAVED. I have made the form page, and i attempted to make the PHP code i got it to work and all, all but the content you wrote to save on the page. It sends it to the page but it dosent save. any ideas?

pyro
11-29-2003, 10:43 AM
Seeing the code would definitly be helpful... ;)

Immortal
11-29-2003, 10:53 AM
Alright here is the form code w/ some of the php:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<body bgcolor="black" text="gray">

<form action="update.php" method="post">
<input type="text" name="Header" size="24" border="0"><br>
<input type="text" name="Date" size="24" border="0">
<p><textarea name="body" rows="18" cols="39"></textarea></p>
<td colspan="2" align="center"><input type="submit" value="Update">
</form>

_____________________
and here is the PHP document 'update.php'


<html>

<head>
<title>Testing</title>
</head>

<body
<h1>TOD</h1>
<h2>UPDATE</h2>
<?php
$header = $HTTP_POST_VARS['header'];
$date = $HTTP_POST_VARS['date'];
$body = $HTTP_POST_VARS['body'];

echo $header.' <br />';
echo $date.' <br />';
echo $body.' <br />';

?>







</html>

pyro
11-29-2003, 10:56 AM
It's not writing it to the page because you are simply echoing the $_POST variables out.

Take a look at this post: http://forums.webdeveloper.com/showthread.php?s=&threadid=22218#post115781.

Immortal
11-29-2003, 11:02 AM
oh thanks alot!

pyro
11-29-2003, 11:04 AM
Sure thing. :)

Immortal
11-30-2003, 09:43 PM
alright well can someone help me with the fwrite() tag to make the updating system work? (look up for the scripts)

pyro
11-30-2003, 10:55 PM
Post your code (the code above isn't even trying to write to a file).

Immortal
12-02-2003, 09:31 PM
yea thats my question how do i make it write?

pyro
12-02-2003, 10:11 PM
fwrite() (http://us2.php.net/manual/en/function.fwrite.php)