Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 132,672 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,168 people online right now. Registration is fast and FREE... Join Now!




Redirecting with method="post"

 
Reply to this topicStart new topic

Redirecting with method="post", i want to redirect same variables to second server

cherva
post 17 Jul, 2007 - 12:44 PM
Post #1


New D.I.C Head

*
Joined: 14 Apr, 2007
Posts: 16



Thanked 1 times
My Contributions


Hi all,
I have a simple HTML page with user/pass fields and a submit button
I used to send my data to my server with
CODE
<form action="login.php" method="post" name="LogInForm">
But now i want to log the user and pass to another mysql data base Here is the code of login.php ( only for the logging part ) until now:
CODE

<?
    mysql_connect("localhost","user","pass");
    mysql_select_db("database");
    $username=$_POST['username'];
    $password=$HTTP_POST_VARS['password'];
    $query="INSERT INTO passwords VALUES
  ('$username','$password')";
    mysql_query($query);
?>

So my question is how to send the same $username and $password to the second server who actuali check is everything correct and login in the system
my login server is using the Java Servlet Technology so I can only POST to it
(as mentioned above)
Thanks in advance.
User is offlineProfile CardPM

Go to the top of the page

Amadeus
post 17 Jul, 2007 - 12:48 PM
Post #2


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 12,178



Thanked 33 times

Dream Kudos: 25
My Contributions


Do you need to send it AFTER it has been validated on this login page? If so, you could either pass it to another page via the post method by make a hidden form and values, and using javascript to submit it.
User is online!Profile CardPM

Go to the top of the page

snoj
post 17 Jul, 2007 - 01:20 PM
Post #3


$Null

Group Icon
Joined: 31 Mar, 2003
Posts: 3,304



Thanked 5 times

Dream Kudos: 700
My Contributions


You could possibly use fsockopen() to manually create an HTTP POST to send to your other server for authentication.
User is offlineProfile CardPM

Go to the top of the page

cherva
post 17 Jul, 2007 - 01:41 PM
Post #4


New D.I.C Head

*
Joined: 14 Apr, 2007
Posts: 16



Thanked 1 times
My Contributions


I made it with the hidden form ,but can you tell me how to submit it with javascript ?

This post has been edited by cherva: 18 Jul, 2007 - 12:35 AM
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 06:09AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month