Help - Search - Members - Calendar
Full Version: web help!
Forums > Resource Center > Webmasters' Corner > Webmasters' Corner Resolved Topics
chauna1212
ok i just started and i was wondering if sum peoples coul help me with some questions i have.




1. how do i make tables?
2. how do i get it so people could comment my site
3. how do i make a form..that actually works =/
4. any suggestions of places i culd go to learn php or html or wht ever i need to learn



ps. srry if any of these were posted..i looked and i didnt see anything about it so yea
thnx!!
freeflow
1. http://pixelfx.org (tutorials > html > regular tables)
2. http://haloscan.com or get a blogging program like wordpress, cutenews, kiwiblog, moveable type or b2.
3. http://pixelfx.org (tutorials > html> email forms)
4. http://www.w3schools.com/
http://www.lissaexplains.com/
http://pixelfx.org
chauna1212
thnk you soooo much
if any1 finds more...plz let me kno =]]
thnx again!!!
IceMouse
1. Make tables:
To make a table, begin it by using the "<table>" tag. After this, you need to create a new row using "<tr>". After this, you make an entry for data using "<td>". After you have your data entered, put in "</td>" and either start a new data entry, or end the row and start a new one. After you have everything entered, finish the table with "</table>". For information about all of "<table>" etc's various options(Width, height, border), check the W3C website.
Example:
CODE
<table>
<tr><td>Row 1, Data 1</td>
<td>Row 2, Data 2</td></tr>
<tr><td>Row 2, Data 1</td>
<td>Row 2, Data 2</td>
</tr></table>


2 & 3. Comments and forms:
There are various ways to go about this, but I'll use PHP for my example. The simplest way(The simplest method is actually a shoutbox, which I'll demonstrate). You simply want to make a form which takes people's input, writes it to a file, and then outputs it to the shoutbox. You could also use MySQL(Which is a little more advanced than I'm willing to write a thread on to answer this question), and using multiple files for multiple comment boxes. Also, for a form, just try and read the code. It's fairly all-encompassing of your questions. Anyhow, on to the script:
CODE
<?php
if(!file_exists("./shoutbox.txt"))
        touch("./shoutbox.txt");
if(isset($_POST["shoutcomment"]))
{
        $name = $_POST["name"];
        $comment = $_POST["com"];
        if(!$fh = fopen("./shoutbox.txt", "a")) die("failure");
        fwrite($fh, $name . "\n");
        fwrite($fh, $comment . "\n");
        fclose($fh);
}
if(!$fh = fopen("./shoutbox.txt", "r")) die("Failure");
?>
<table>
<?php
while(!feof($fh))
{
        echo "<tr><td>" . fgets($fh) . "</td><td>" . fgets($fh) . "</td></tr>";
}
fclose($fh);
?>
</table>
<form action="?" method="POST">
<input type="text" name="name">
<input type="text" name="com">
<input type="hidden" name="shoutcomment" value="1">
<input type="submit" value="submit">

NOTE: Don't use that script. Please, for the love of God. It's only an example. If you use it, bad things will befall your website. I don't even know if it works. But it's a very poorly written POC script. Also, if you want to test the script you'll need to make sure that your apache process(Or whatever httpd you use) is able to write to a file in the directory called "shoutbox.txt" or has write permissions in the directory.

4. Google
keithcash
WoW. This is some good code links and help.

Thanks I will review and hopefully learn.

Slainte / Cheers
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.