help me, im really beginner

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
yaqeane
Forum Newbie
Posts: 12
Joined: Wed Jun 07, 2006 8:57 am

help me, im really beginner

Post 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
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
User avatar
ok
Forum Contributor
Posts: 393
Joined: Wed May 31, 2006 9:20 am
Location: The Holy Land

Post by ok »

The PHP manual is the best resource: http://www.php.net/manual/en.
yaqeane
Forum Newbie
Posts: 12
Joined: Wed Jun 07, 2006 8:57 am

Post by yaqeane »

owh ok thank you very much, can u teach me other skill
User avatar
ok
Forum Contributor
Posts: 393
Joined: Wed May 31, 2006 9:20 am
Location: The Holy Land

Post 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";
}

?>
yaqeane
Forum Newbie
Posts: 12
Joined: Wed Jun 07, 2006 8:57 am

Post 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
yaqeane
Forum Newbie
Posts: 12
Joined: Wed Jun 07, 2006 8:57 am

Post by yaqeane »

owh thank your very much "OK" u r realy kind programmer.
User avatar
ok
Forum Contributor
Posts: 393
Joined: Wed May 31, 2006 9:20 am
Location: The Holy Land

Post 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>
yaqeane
Forum Newbie
Posts: 12
Joined: Wed Jun 07, 2006 8:57 am

Post by yaqeane »

which one easy bro, frontpage or dreamwever. but im most suitable built website with frontpage..
yaqeane
Forum Newbie
Posts: 12
Joined: Wed Jun 07, 2006 8:57 am

Post 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
User avatar
ok
Forum Contributor
Posts: 393
Joined: Wed May 31, 2006 9:20 am
Location: The Holy Land

Post by ok »

Editplus... :D
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.
yaqeane
Forum Newbie
Posts: 12
Joined: Wed Jun 07, 2006 8:57 am

Post 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.
yaqeane
Forum Newbie
Posts: 12
Joined: Wed Jun 07, 2006 8:57 am

Post by yaqeane »

hey man, how to connect php n mysql.. can u show me some example.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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.
yaqeane
Forum Newbie
Posts: 12
Joined: Wed Jun 07, 2006 8:57 am

Post 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
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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.
Post Reply