Redirect to another page with created account

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
hungtd7
Forum Newbie
Posts: 1
Joined: Fri Oct 16, 2009 9:30 pm

Redirect to another page with created account

Post by hungtd7 »

Hi!

I want to create a website can redirect to another page while user enter in. And my website will auto login. This action hide with user.

I tried cURL (PHP) but i can not do that.

For example with user: user and password: password and Site : http://admin.5socks.net/


My Code:

Code: Select all

 
<?php
    $ch = curl_init();
    $POSTFIELDS = "user=[user]&pass=[pass]&action=login";
    
    curl_setopt($ch, CURLOPT_URL, "http://admin.5socks.net/cgi-bin/login.cgi");
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS,$POSTFIELDS);
    $str = curl_exec($ch);
    $return =curl_close($ch); 
?>
 


Thanks a lot.
Have a nice day :-)
Post Reply