[HELP] Just a little question about PHP/DB's

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
Andy11548
Forum Newbie
Posts: 5
Joined: Sat Jul 24, 2010 1:55 pm

[HELP] Just a little question about PHP/DB's

Post by Andy11548 »

Hello.

I seem to be having a problem with Php. I'm fairly new to it, but have set myself a task to code a fully functional Php Website. So far I have made a Log In page that works and a Registration page that works.

Now i'm trying to create a Contact Us page that works.

I want it to be like

<?php echo "$name" ?>
<?php echo "$username" ?>

Blah blah blah. So that it appears like
"Name: Andy ********"
"Username: Andy"
"Email: Andy@example.com"

"Subject: [drop down menu]"

ect.

Anyway. Is there a way I've got it to work with "Username: "$username"" but I can't get it to detect the session and retrive the session data from the Database for Name or Email.

If anyone could help me I would be greatly apprectiated.

Thanks,
"$username" :P
oscardog
Forum Contributor
Posts: 245
Joined: Thu Oct 23, 2008 4:43 pm

Re: [HELP] Just a little question about PHP/DB's

Post by oscardog »

Might want to paste in your code(using code tags) so we can correct it.

Also creating a login/registration page when you're new to PHP is probably not the best idea as it is likely to have some security flaws in it. May want to read a tutorial on creating a secure login/registration to make sure you've covered all the bases.
Andy11548
Forum Newbie
Posts: 5
Joined: Sat Jul 24, 2010 1:55 pm

Re: [HELP] Just a little question about PHP/DB's

Post by Andy11548 »

oscardog wrote:Might want to paste in your code(using code tags) so we can correct it.

Also creating a login/registration page when you're new to PHP is probably not the best idea as it is likely to have some security flaws in it. May want to read a tutorial on creating a secure login/registration to make sure you've covered all the bases.
The only thing i've secured are the passwords with md5 encryption and it also strip_tags so that people can't make stupid names. It also retrives the information from the database, and when you enter the password to log in, it encrypts that, and compares it to the encrypted password in the database. If they match, it logs you in :).

Anywayz. I'm not even sure how I did this with the $username thing. Could you not just explain what to do? I can work out where to put it ect. I'm not that much of a idiot ;).
Post Reply