General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #31  
Old July 15th, 2003, 01:18 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
Send a message via ICQ to dhouston
You've still got one thing backward:

PHP Code:
 $_POST['Username'] = "$Username";
$_POST['Password'] = "$Password"


should be

PHP Code:
 $Username=$_POST['Username'];
$Password=$_POST['Password']; 


As it currently stands, you're overwriting posted variables with blank values. Somebody earlier in the thread made a note of this (just didn't want to come across as if I was taking credit for the fix).

Reply With Quote
  #32  
Old July 15th, 2003, 01:48 PM
dfano dfano is offline
Always Learning (I Think)
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: NYC Baby!!!!
Posts: 123 dfano User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 15
Send a message via AIM to dfano Send a message via Yahoo to dfano
thanks i thought i fixed that.

now we got:

Warning: Cannot modify header information - headers already sent by (output started at /home/virtual/site33/fst/var/www/html/php/sendinfo.php:9) in /home/virtual/site33/fst/var/www/html/php/sendinfo.php on line 42

i dont think i cut out for this stuff

why is it that almost every time i use the "header" command i get that same error.


Dave

Last edited by dfano : July 15th, 2003 at 02:02 PM.

Reply With Quote
  #33  
Old July 15th, 2003, 02:41 PM
avit avit is offline
Not Yet Perfect
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Squamish, BC
Posts: 111 avit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
Send a message via ICQ to avit
Yeah, you still have this part backwards!
PHP Code:
 $_POST['Username'] = "$Username";  
$_POST['Password'] = "$Password"

That means put the value of $Username into $_POST. You need to have that the other way:
PHP Code:
 $Username $_POST['Username'];
$Password $_POST['Username']; 

This will put the value of $_POST into $Username. Also, no quotes around the variable names.

Sorry, posted too late. I see you already got that info...

Take out the echo's for your header bit to work. You need to have a "clean slate" to send headers. No spaces or returns outside of <?php tags either. That counts as "sending content" too.

Last edited by avit : July 15th, 2003 at 02:44 PM.

Reply With Quote
  #34  
Old July 15th, 2003, 02:50 PM
dfano dfano is offline
Always Learning (I Think)
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: NYC Baby!!!!
Posts: 123 dfano User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 15
Send a message via AIM to dfano Send a message via Yahoo to dfano
thanks

dave

Reply With Quote
  #35  
Old July 15th, 2003, 02:52 PM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 650 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 34 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
Dave... put this in your code

ob_start();

ob_flush();

Put ob_start(); at the very beginning, just below the <?php tag

and ob_flush(); just before the ?> tag


example:
PHP Code:
<?php
ob_start
();

//...
// your code goes here....
//...

ob_flush();
?>
then repost your results

Last edited by nicat23 : July 15th, 2003 at 02:55 PM.

Reply With Quote
  #36  
Old July 15th, 2003, 02:58 PM
dfano dfano is offline
Always Learning (I Think)
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: NYC Baby!!!!
Posts: 123 dfano User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 15
Send a message via AIM to dfano Send a message via Yahoo to dfano
AAAAAHHHHHHH!!!!!!!!

same error
here is the code:

Quote:
<?php
ob_start();
$Host = "localhost";
$db_User = "*";
$db_password = "*";
$db_name = "*";
$Username=$_POST['Username'];
$Password=$_POST['Password'];
$svrConn = mysql_connect ($Host,$db_User,$db_password);
if($svrConn) {
$dbConn = mysql_select_db ($db_name,$svrConn);
} else {
echo "did not connect to database";
}
if ($dbConn){ //this assumes that you already
//successfully connected to the database
$strQuery = "SELECT Username, Password, custurl FROM Users ";
$strQuery .= "WHERE Username = '$Username' ";
$strQuery .= "AND Password = '$Password'";
//This also assumes that you already have the username and password
$results = mysql_query($strQuery);
$result = mysql_fetch_row($results);
if ($result){
$custurl = $result[6];
header("Location: $custurl");
} else{
echo "No results returned.";
}
}
ob_flush();
?>


i really owe you guys

dave

Last edited by dfano : July 15th, 2003 at 04:11 PM.

Reply With Quote
  #37  
Old July 15th, 2003, 03:13 PM
avit avit is offline
Not Yet Perfect
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Squamish, BC
Posts: 111 avit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 16
Send a message via ICQ to avit
Does anything show on the page before the error? Do you have any blank lines or spaces before the first <?php tag? You need to be sure those are gone. Shouldn't really need ob_start/flush here, but it doesn't hurt I guess.

Reply With Quote
  #38  
Old July 15th, 2003, 03:14 PM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 650 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 34 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
take out all of the echo's that you put in there for debugging, and take out the ob_start and ob_flush, see if that helps...

Reply With Quote
  #39  
Old July 15th, 2003, 03:21 PM
dfano dfano is offline
Always Learning (I Think)
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: NYC Baby!!!!
Posts: 123 dfano User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 15
Send a message via AIM to dfano Send a message via Yahoo to dfano
i give up.....


try it, it work but now i think i have a server problem, im going to e-mail the tech guy.

http://www.fs3d.com/php/adminlogin.htm

User - dave
pw - 1234

i get a forbidden error

i went in and changes the permisions on that directory to
777 - same crap

thanks again

dave

Last edited by dfano : July 15th, 2003 at 04:11 PM.

Reply With Quote
  #40  
Old July 15th, 2003, 03:39 PM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 650 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 34 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
didn't get a problem when I used it, it just didn't redirect...

Reply With Quote
  #41  
Old July 15th, 2003, 03:46 PM
dfano dfano is offline
Always Learning (I Think)
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: NYC Baby!!!!
Posts: 123 dfano User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 15
Send a message via AIM to dfano Send a message via Yahoo to dfano
Amazing!!!!!!

holy CRAP

it works, woooo hoooo it works.

ill be back at it soon, i learn this stuff eventually (i hope)

on to sessions whoopy, i'll read some PHP Black Book first then i will start to bother.


thanks again to all you guys,

Dave

Last edited by dfano : July 15th, 2003 at 04:03 PM.

Reply With Quote
  #42  
Old November 23rd, 2003, 11:54 AM
drjonesuk drjonesuk is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 1 drjonesuk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to drjonesuk
Hey FOlks

Ive been GLUED to the screen reading this POST, I want EXACTLY
the same thing, now Can i get some people back here to give me the code so I can use it in my website now

i want a user to login and be directed to a private page

now, do i muck around for hours, or simply ask for the code, ill just ask

hit me

australia friend (lol)

Reply With Quote
  #43  
Old November 26th, 2003, 05:21 PM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 650 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 48 m 34 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
drjone: Why dont you post what code you *do* have as opposed to asking for someone to write and design the code for you? That might get more users looking at the thread, also may I suggest you start another thread for this topic ? It'd keep things less cluttered..

We're more than happy to help, but there arent many who will just *give* code away...

Thanks..

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > User Login - url redirection?


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap