Hiya,
I'm a bit of a PHP newbie, so forgive me if my question is a amateurist. What i'm looking to do, is create a form on PHP which outputs to a website. ie, the data entered in the form will appear on the website in a specified manner.
For example:
Say I create a form which has 2 fields, "News" and "date"...someone should be able to enter info into these 2 fields and have it appear on a website, already appropriatley formated. eg, the date would be size 10 font, and the news a size 12.
How would I go about doing this?
I have basic PHP knowledge.
PHP Form Which posts onto a website.
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Moved to PHP Code.
To do this you'll need to understand how to read POST or GET data. You'll also need a MySQL database or some other way of storing the information.
Have a look at the PHP website at http://www.php.net/ You'll find some tutorials on there for doing the GET/POST part.
A quick and extremely basic example of handling POST data would be this:
some_file.php
You'll need at least a basic grasp of PHP syntax before you go on to do any database work with it 
To do this you'll need to understand how to read POST or GET data. You'll also need a MySQL database or some other way of storing the information.
Have a look at the PHP website at http://www.php.net/ You'll find some tutorials on there for doing the GET/POST part.
A quick and extremely basic example of handling POST data would be this:
Code: Select all
<form action="some_file.php" method="post">
Send this value to a PHP script: <input type="text" name="some_value" />
</form>Code: Select all
<?php
echo $_POST['some_value'];
?>after that,you would use somethnigl liked11wtq wrote:Moved to PHP Code.
To do this you'll need to understand how to read POST or GET data. You'll also need a MySQL database or some other way of storing the information.
Have a look at the PHP website at http://www.php.net/ You'll find some tutorials on there for doing the GET/POST part.
A quick and extremely basic example of handling POST data would be this:
some_file.phpCode: Select all
<form action="some_file.php" method="post"> Send this value to a PHP script: <input type="text" name="some_value" /> </form>You'll need at least a basic grasp of PHP syntax before you go on to do any database work with itCode: Select all
<?php echo $_POST['some_value']; ?>
Code: Select all
while($row=mysql_fetch_array($result,MYSQL_ASSOC)) {/*this will get you the whole row and put into an array with the column names.\n Replace the date and news with real names of the columns.*/
//put the font formatting for each thing,like this
/*
echo '<font size=10>$row['date']</font><br>'
echo '<font size=12>$row['news']</font><br>'
*/
}- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York