Silkroad Online Forums

A community forum for the free online game Silkroad Online. Discuss Silkroad Online, read up on guides, and build your character and skills.

Faq Search Members Chat  Register Profile Login

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: HTML/PHP Help >.>
PostPosted: Tue Oct 30, 2007 10:02 pm 
Advanced Member
User avatar
Offline

Joined: Jan 2007
Posts: 2317
Location:
Off Topic
on my webby for school, im trying to get my text fields to log all entries so my html file looks like


...."
<center><font> Please enter your first and last name.</font></center>
<form action="PHP.php" method="get" autocomplete="off">
First Name: <INPUT name="First Name" value="" size="10"><BR>
Last Name: <INPUT name="Last Name" value="" size="10"><BR>
<CENTER><INPUT type="submit"></CENTER>
</form>"

PHP.php contains

"<?php
header("Location: Home.html");
$handle = fopen("log.txt", "a");
foreach($_GET as $variable => $value) {
fwrite($handle, $variable);
fwrite($handle, "=");
fwrite($handle, $value);
fwrite($handle, "\r\n");
}
fwrite($handle, "\r\n");
fclose($handle);
exit;
?>"

and it should record entries in log.txt

but when i try 2 submit the names 2 see if it recoreded, and nothing comes up in teh log :(

$value) { fwrite($handle, $variable); fwrite($handle, "="); fwrite($handle, $value); fwrite($handle, "\r\n"); } fwrite($handle, "\r\n"); fclose($handle); exit; ?>



btw i have no idea if teh php is right, its probably where the wrong is we didnt take php yet :x

any help pleaseee

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 30, 2007 10:03 pm 
Active Member
User avatar
Offline

Joined: Sep 2007
Posts: 857
Location: Rappelz<botroad online
are you trying to hack us???
lol jp i wish i could help ya, im still trying to learn all the lang :/

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 30, 2007 10:04 pm 
Advanced Member
User avatar
Offline

Joined: Jan 2007
Posts: 2317
Location:
Off Topic
i are big noobie, im ehh @ html and big noobie wit php :(

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 30, 2007 10:12 pm 
Ex-Staff
User avatar
Offline

Joined: Oct 2006
Posts: 2732
Location: Waterloo
I hate PHP, I'll never code anything myself in it O_O

But I'd suggest you use the DIV tags and set the alignment to center instead of using the HTML CENTER tag.

_________________
DID YOU KNOW? Milly has retired!!!!


Status: Into Minecraft

ImageImage


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 30, 2007 10:47 pm 
Loyal Member
User avatar
Offline

Joined: Apr 2006
Posts: 1999
Location:
Off Topic
Sounds like the file is read-only. Also, you can combine variables and strings with a period. :P

Try this:
Code:
<?php
ob_start();
$handle = @fopen("log.txt", "ab") or die("Couldn't open log for writing!");
header("Location: Home.html");
foreach($_GET as $variable => $value)
   fwrite($handle, $variable."=".$value."\r\n");
fwrite($handle, "\r\n");
fclose($handle);
?>
If fopen can't open the file for writing then you'll get the error, otherwise the header will be sent as normal.

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group