Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding info to other page

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
<?php
Header(&quot;Location:suplijst.html&quot;);
?>
<!doctype html public &quot;-//W3C//DTD HTML 4.0 //EN&quot;>
<html>
<head>
<title>Supporter toevoegen</title>
</head>
<body>
<?php
$uitvoerbestand = &quot;suplijst.html&quot;;
$bestandsindex = fopen($uitvoerbestand,&quot;a&quot;);
for($i=1; i<count($bestandsindex); $i++)
if($bestandsindex[$i] == &quot;<table border=1 color=white>&quot;)
fwrite($bestandsindex, &quot;<tr><td> $nick </td> <td> $naam </td><td> $voornaam </td><td> $quote </td>&quot;);

fclose($bestandsindex);
?>
</body>
</html>

so, in the document &quot;suplijst.html&quot; I want to add the given information after the line <table ... > and everything that is written after that tag has to be placed after the information I added. But is doesn't work. This is what is in my &quot;&quot;suplijst.html&quot; document :

<!doctype html public &quot;-//W3C//DTD HTML 4.0 //EN&quot;>
<html>
<head>
<title>Supporterslijst</title>
</head>
<body bgcolor=black>
<table border=1 color=white>

</body>
</html>

Can someone tell me how to solve this ?
THX :)
 
what exactly do you want to do?
that header() directive causes that you are redirected to that file without even looking at your code
 
But the header doesnùt give an exit, does it ? So, it should actually add the information and I would be able to see that information if I refresh. Even if I remove the header clause, it doesn,t work.

In the result file, a table should be created and for each different person, a new row is created with his information
 
so why using the header directive

just generate the table in the file where's the header clause

do it like this
<?
$output = '
<html>
<body>
<table>';
/*here fill in your table with your data*/
/*get data into variables/*
do {
$output .= '<tr>
<td>'.$nick.'</td>
<td>'.$naam.'</td>
<td>'.$voornaam.'</td>
<td>'.$quote.'</td></tr>';
}
while (you have data to display);
$output .= '</table>
</body>
</html>;'
echo $output;
?>
 
that could be a solution. But what I was trying to do was to generate a file with the info and later on, when someone new wanted to send their information, add this information to that file. So I would become a file with a table and later on, I could add this new person to that table. If I want it to do like you are suggesting, I would have to use a database
 
you don't need to
just write the data to a textfile on your web server and every time you want to add a new person, just write at the end of that file
do not write there the html tags, it's better to write there just data, comma separated or so, the php code would be easier
 
But if I do it like that, I cannot close my tags, and I cannot put a picture or anything else beneath my reactions. That's why I actually wanted to do it like that. The method you are suggesting is indeed very simple and that is how I did it at first
 
i think the simpliest way is the best way

an with the pictures, there's always a way how to do that
what about using ids for the pictures and inserting those in the text file? that's my firts idea, sure there's another one, better one
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top