/    Sign up×
Community /Pin to ProfileBookmark

PHP help for dummies

Ok first off I don’t even know the best way to go about this, but I am working on a gaming fan site and want to be able to have a review section that is stored in a database and produces a html page. All the data needs to be entered into form with several boxes to allow users to fill in with text. Any suggestions are will be a real help. I am also doing this all without the use of any portal software.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@katasovaNov 10.2005 — hi there, before anything else happen i want to say my english is not very good but i want to hlp u hehe ?

I bet u already have Apache or IIS or any server installed in ur PC so u can test all u do in localhost. If u dont i suggest WAMP server if u use PC or MAMP if u use Mac. Just look for any of this in google, download it and install it...

Now if u have the forms rdy do something liek this:

[code=html]

<form action="nextPage.php" method="POST" name="something">
....
</form>
[/code]


Now in the page named 'nextPage.php'
[code=php]
$name = $_POST["name"]; //$name is the name of ur variable where u store data from users.... $_POST["name"]; is the call to the value of the form (name) in the last page that u want to save

....

$user="root";
$pass="root";
$server="localhost";
$base="base";
$connect=mysql_connect($server,$user,$pass) or die ("Error."); //connect to sql

mysql_select_db($base ,$conect) or die("Error."); //select DB

//time to save ur data in DB

$query = "INSERT INTO table (NAME, Email.....) VALUES '$name', '$email', ....";


$res = mysql_query(query) or die ("Error");

// if u didnt got any error then teh data is saved in ur DB
[/code]


Now just add some html code here to say ur user that u saved his data in the DB, thx for choose ur page, etc....

Hope this hlp u, if u want an easy example i made some time ago send me an email to [email][email protected][/email] and il send u back the source code...
×

Success!

Help @rebelxug spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...