Novahq.net Forum

Novahq.net Forum (https://novahq.net/forum/index.php)
-   Web design and Programming (https://novahq.net/forum/forumdisplay.php?f=32)
-   -   PHP (code not nuke) Help (https://novahq.net/forum/showthread.php?t=23514)

KoBrA 03-12-2005 11:51 PM

PHP (code not nuke) Help
 
ok well i've looked around (not very good searcher) and i can't find anywhere that teaches u how to make a login system ... lmao .. i've even bought a book PHP and MySQL for dummies ... emm well that was a alot of help ... it explained everyting ... but it didn't work ..and i even went and got the authors work and tried again ... no workie ..

so could someone help me out here


and also i was looking for a form scipt in php ... i just want to it to be able to do this:

person come to site ...
person fill out form ...
person submit .. it go to a email of my chosing ....
person get an email to the email they submited in form saying i recieved their form ....

and i use dreamweaver MX 2004

plz help me lol

tys

JonM 03-13-2005 12:10 AM

lol a lot of requests...

now i know this may be confusing but:

For your form...use the mail(); function and $_POST[];

For your User System

Provide more info, do you wish to use sessions, cookies, etc..etc..
also did u read teh book cover to cover? might help!!!

Scott 03-13-2005 12:29 AM

Bored
 
1 Attachment(s)
Include this file at the very top of your php files where you want users to login.. You can also use SSI to do this. Search google for ssi include.

Scott 03-13-2005 12:29 AM

BoredII
 
1 Attachment(s)
Very basic and not very formatted.. but it does what you asked.. yeah i'm bored..

KoBrA 03-13-2005 01:03 AM

omg wow ... ty ... its late i'll work on it tomorrow ...

ty very much


btw i like your new site design


i did look at it quickly, i also forgot to mention, how to make a regisation page .. that conects with mySQL and stores data.. and then a login area the uses those users data (which u gave me)

how would i do that .. or where is a place that would tell me

KoBrA 03-13-2005 01:06 AM

o and elite .. i didn't read it cover to cover ... i just read the several chapters contain the Members only Section ..

but i might read the rest to get info

Stu 03-13-2005 06:21 AM

re.
 
Hi kobra, heres some code for the registration page your after, remember to look carefully at the code to understand what its doing, dont just copy and paste it. The princibles are very basic;
- First I'm going to connect to the Mysql server (mysql_connect.php)
- Next I'm going to select a database (mysql_connect.php)
- Then I'll display the form for a user to fill in (register.php)
- When submit is hit, all the infomation will be submited to the tables for the selected database (register.php).
- We probally want to create the tables to, dont we? So I threw some code together for you ;) (install.php)
- You'll need to edit the string vaules in mysql_connect.php
.
Code for mysql_connect.php
Code for register.php
Code for install.php
All this code has been tested and works, use panthers code with it, 'cause I know it does work :gj:. Hope you enjoy it
~ Regards

JonM 03-13-2005 09:16 AM

here's a script you'll need to change, but it's a very basic one:

PHP Code:

<?
/*Connect*/
$connect=mysql_connect("localhost","username","password") or die(mysql_error());
mysql_select_db("db",$connect) or die(mysql_error());

/*Form*/
echo'<form>';
/*Insert*/
if(!empty($userfile)){
//minor change to tecoma2's thing...
$get="SELECT * FROM db WHERE username='$username'";
$finish_get=mysql_query($get);
$check=mysql_num_rows($finish_get);
if(
$check>="1"){  //you may need to remove the qoutes, i'm not thinking that clearly yet....
echo'Nope';
}
else
{
echo
'Yes';
Do 
registration crapp....
}
?>

Now i didn't realize that tecoma2 made a whole script, until aobut half way through this...

Any ways mines a quicky, and tecoma2 nj, didn't realize you were learning php :gj:

and kobra, take a while and look some of this up, because if you can't connect to a database after reading the php&mysql for dummies, you need to read some tuts online

KoBrA 03-13-2005 01:01 PM

alrighty ... ty very much

yall been very big help

Stu 03-14-2005 01:51 PM

Yup elite, being doing well with it lately, been doing it for about 4 months, never posted much about it here. :)
Hope that helps you kobra, elite done some good stuff there to :gj:

JonM 03-14-2005 06:42 PM

lol been working on for about two freaking years...except now i'm choosing to really buckle down and work lol :D

KoBrA 03-15-2005 07:17 PM

o well i can connect to databases .. and run that kind of script ... just a matter of tiing the quey or w/e code to the registration form to is it creates the new info in tha table

Stu 03-16-2005 04:18 PM

Quote:

Originally posted by KoBrA
o well i can connect to databases .. and run that kind of script ... just a matter of tiing the quey or w/e code to the registration form to is it creates the new info in tha table
are you confused, or it doesnt work for you? Let me explain the registeration code...
- First off, it calls mysql_connect.php, which connects to the mysql server and selects the database.
- Next, if the title username in the form elements isn't empty, it will use the infomation in the $sql string to insert the data.
[1] Dont be confused by the $sql string.
[2] Its just a way of sorting infomation shorter
- Now it go's onto the $query string, which uses $sql as its caller, the $query string inserts the data in. And if theres an error, it prints it on screen.
- Then the else statement, it go's onto the HTML form.
- At the end of the document i put } to end that else statement
:).
Hope that helped you, but you probally werent stuck anyway lol.
- Regards

KoBrA 03-20-2005 09:52 PM

ooo no i understand the scipt lol

im not confused

i was talkin bout my own coding ... and tryin to do it lol

NaughtyPerry 03-21-2005 10:30 AM

lol t2 is alot of help :) get busy with our site btw :p lol

KoBrA 04-15-2005 06:02 PM

hum ... well now that i've to designs to apply this to ... everythign works except the login

all the code is the same as posted here, but i changed the mysql connect ...

something is wrong with the login code or im doing something wrong

DevilDog#1 04-15-2005 08:29 PM

Login is the easiest to do if you know what you're doing.

(Hint: Start with basic idea and then add stuff to it. ;) )

KoBrA 04-15-2005 11:16 PM

well that was a big help... NOT ..,

as i said the login does not work ... code and stuff appear on the page ... and u can't login with the registered info u entered on the registration page

could someone help me, im using the code that was presented on the first page

DevilDog#1 04-15-2005 11:29 PM

When asking for help there are certain rules:

1. Be nice.
2. Don't insult others.
3. Don't be sarcastic.
4. Explain the problem complete and do not babble like a mindless drone.
5. If you get errors post it.

Now you were saying?

KoBrA 04-15-2005 11:38 PM

well same to u ... but u didn't have to say that in the first place ..

now srry bout that ... but the problem is just as above .. either is my webserver or the code ... the code is on the first pace where Panther so nicly posted it, then Tecoma posted the other parts...
the login is not working for me ... when i mean not working its not working .. like it won't login ... and there is scipt showing too

http://www.kobra.daveswebhosting.net...ance/login.php

u can move to that directory and got to the register page and try loging in
then you will see what im talking about


All times are GMT -5. The time now is 10:22 AM.

Powered by vBulletin®