Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 01-18-2003, 05:03 PM   #1 (permalink)
trevor
Code Monkey
 
Join Date: Jan 2003
Location: Canada
Posts: 91
trevor is on a distinguished road
narrowed down login trouble

I have the user enter login and password using:

<form name="login" method="post" action="login.php">
<input type="text" name="Array[username]">
<input type="password" name="Array{password]">
<input type="submit" name="Submit" value="Login">

then in my login script I just put:

<?
include("connect.php");
$password=$Array[password];
$username=$Array[username];
print("\n\n username: $username password: $password");
?>

now I have my connect.php print "connection successful" if I connects successfully, which it does so that part is correct.
but it doesn't print the username and password.

I think I am doing something wrong with the Array[password] and [username]. either they aren't getting sent from index.php to login.php or I am stupid and don't know my PHP functions.

thanks for everyones help so far,

Trevor
trevor is offline   Reply With Quote
Old 01-18-2003, 05:18 PM   #2 (permalink)
anon
Guest
 
Posts: n/a
do:


<form name="login" method="post" action="login.php">
<input type="text" name="username">
<input type="password" name="password">
<input type="submit" name="Submit" value="Login">

Then have action.php do:

$name=$_GET['username'];
$pass=$_GET['password'];
  Reply With Quote
Old 01-18-2003, 05:21 PM   #3 (permalink)
trevor
Code Monkey
 
Join Date: Jan 2003
Location: Canada
Posts: 91
trevor is on a distinguished road
where does action.php come from?
trevor is offline   Reply With Quote
Old 01-18-2003, 05:23 PM   #4 (permalink)
anon
Guest
 
Posts: n/a
DOH! login.php... woops

EDIT: also instead of form method=post do method=get
  Reply With Quote
Old 01-18-2003, 05:35 PM   #5 (permalink)
trevor
Code Monkey
 
Join Date: Jan 2003
Location: Canada
Posts: 91
trevor is on a distinguished road
still not working
Is there anything else I could be forgeting?
its such a simple concept.

thanks,

Trevor
trevor is offline   Reply With Quote
Old 01-18-2003, 05:36 PM   #6 (permalink)
anon
Guest
 
Posts: n/a
Quote:
Originally posted by trevor
still not working
Is there anything else I could be forgeting?
its such a simple concept.

thanks,

Trevor
Try instead of form method=post try form method=get

It worked for me when I did that (changed post to get)
  Reply With Quote
Old 01-18-2003, 05:48 PM   #7 (permalink)
trevor
Code Monkey
 
Join Date: Jan 2003
Location: Canada
Posts: 91
trevor is on a distinguished road
ah ha ha ha

IT WORKS!!

ok that set me back about 6 hours.

thanks man, I owe you huge,

Trevor
trevor is offline   Reply With Quote
Old 01-18-2003, 05:50 PM   #8 (permalink)
anon
Guest
 
Posts: n/a
"thanks man, I owe you huge, "

If you want I can give you my some way of giving me large amounts of money in a short amount of time over the internet


Welcome, hope it works for ya
  Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS Explorer trouble (of course) easilyi HTML, XML, Javascript, AJAX 6 11-11-2004 03:59 PM
login session help please Namraw PHP 2 09-14-2004 03:26 PM
trouble with some image upload code trevor PHP 11 02-11-2003 07:09 AM
login script trevor PHP 21 01-17-2003 06:28 AM


All times are GMT -8. The time now is 11:24 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting