Page 1 of 1
help me, im really beginner
Posted: Wed Jun 07, 2006 9:04 am
by yaqeane
Hey guys, hope this is not for spamming, i really want to learn a lot about PHP.
i already have the basic tool for built my own web with php like easyphp. and mysql also apache
Im very sad because when i learn from the dummy book i cant understand. So i hope my friend can help me.
firstly how to create login and register form.
how to make php script run properly, where i want to put the script.
Seriously im very dummy even i already diploma holder in information tech.
help me guys.
i want start from first.
Thanks guys
Posted: Wed Jun 07, 2006 9:27 am
by ok
The PHP manual is the best resource:
http://www.php.net/manual/en.
Posted: Wed Jun 07, 2006 10:12 am
by yaqeane
owh ok thank you very much, can u teach me other skill
Posted: Wed Jun 07, 2006 10:24 am
by ok
Login:
Code: Select all
<html>
...
<body>
<form action="login.php" method="post">
<input type="text" name="username">
<br>
<input type="password" name="pwd">
<input type="submit" value="Login">
</form>
</body>
</html>
Login.php:
Code: Select all
<?php
session_start();
if((isset($_SESSION['log'])) && ($_SESSION['log'] == 1))
{
echo "already logged";
}
$username = $_POST['username'];
$pwd = $_POST['pwd'];
mysql_connect($mysql_host, $mysql_user, $mysql_pwd);
mysql_select_db($mysql_db);
$query = "SELECT * FROM `users` WHERE `user` = '".$username."'"; //Lets say that `user` is UNIQUE
$result = mysql_query($query);
$pwd_result = mysql_result($result, 0, "pwd"); //Select the first result and col `pwd`. (`user` is UNIQUE so there is only one result).
if($pwd_result == $pwd)
{
$_SESSION['log'] = 1; //Means for the script that the user is logged.
echo "logged";
}else{
echo "bed login in, go back to the login screen and try again";
}
?>
Posted: Wed Jun 07, 2006 10:25 am
by yaqeane
one more question. where to write the php code, iz it in html or other. anyone help me
for example
<?php
echo "<textarea name='mydata'>\n";
echo htmlspecialchars($data)."\n";
echo "</textarea>";
?>
i try to write the coding in html and i save the file with .php iz it true. And i put into htdocs
Posted: Wed Jun 07, 2006 10:26 am
by yaqeane
owh thank your very much "OK" u r realy kind programmer.
Posted: Wed Jun 07, 2006 10:30 am
by ok
There are 2 ways to write PHP:
1. PHP file (.php):
Code: Select all
<?php
echo "<html>
...
<body>
Hello world
</body>
</html>";
?>
2. Inside a HTML file (save it with .php ext):
Code: Select all
<html>
...
<body>
<?php echo "Hello world"; ?>
</body>
</html>
Posted: Wed Jun 07, 2006 10:30 am
by yaqeane
which one easy bro, frontpage or dreamwever. but im most suitable built website with frontpage..
Posted: Wed Jun 07, 2006 10:31 am
by yaqeane
did u have yahoo msgr or msn msgr .. may i add u for further information. it more easy to discus.. i hope im not disturbing u bro
Posted: Wed Jun 07, 2006 10:33 am
by ok
Editplus...
I don't work with those softwares... don't like them!
EditPlus is the best (in my opinion):
http://www.editplus.com
You can look
viewtopic.php?t=6288 for additional editors.
Posted: Wed Jun 07, 2006 10:43 am
by yaqeane
i trying to understand the manual for edit plus.. thanks bro. bro add me at yahoo msgr centrino187 and msn msgr royal_playground.
Posted: Wed Jun 07, 2006 11:21 am
by yaqeane
hey man, how to connect php n mysql.. can u show me some example.
Posted: Wed Jun 07, 2006 11:28 am
by RobertGonzalez
You should try searching these forums for what you want to do. Then, search google for what you want to do. Then, try something and when that fails, ask us why it failed. I am not intending to be rude (though it almost sounds that way

) but it appears as though you want a personal tutor to guide you through learning PHP development (which I am sure some here would gladly do for you at the right price). But what you are asking are things that are usually spelled out in PHP books and tutorials.
You may want to also look at Kevin Yank's (
Sitepoint) book
Build Your Own Database Driven Website Using PHP & MySQL. Download the sample chapters and practise what he mentions in the examples. My very first PHP app was taken straight from those examples and within a week I had managed to make my own PHP app.
Try it. If it doesn't work, post back here with the problems you are facing.
Posted: Wed Jun 07, 2006 12:50 pm
by yaqeane
thank you so much everah for your advice, i really appreciate it. I dont care for who want angry with me but i take it as my spirit to achieve my goal.
ok guru. sory because this is my fault, and i try to choose easy way.. but thats true guru.. we must try it first,research deeply. Ok guru thanks again
Posted: Wed Jun 07, 2006 1:38 pm
by RobertGonzalez
I wouldn't say that anyone is angry with you. This community is an excellent resource for help with your learning. When I say that, I mean we will always try to point you in the direction you should go to achieve what you want to achieve. Most folks around here will never do something for you that you have not honestly and earnestly tried to accomplish yourself.
It is also a very good idea to have some knowledge of PHP terms and language. This is because, though we try to keep things as simple as possible, even some of the simplest things can be confusing to someone that doesn't know we're talking about.
Keep plugging along. Try stuff. And when your programs die, try something else. And then, when things go haywire again, let us know so we can help you with it.
And thanks for contributing to this community. People needing help is what keeps this place helping people.