User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 375,229 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,266 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 524 | Replies: 5
Reply
Join Date: May 2008
Posts: 3
Reputation: cybernet is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
cybernet cybernet is offline Offline
Newbie Poster

cURL question

  #1  
May 2nd, 2008
i have this code
 <?
/* Download google.com pretending to be refered by yahoo.com */
$hc        = new eHttpClient();
$hc->setReferer("http://www.x1.com/");
$html        = $hc->get("http://www.x2.com/?admin_pass=admin&add_user=user_name&pass_word=password");
$headers    = $hc->getHeaders();
$header        = $hc->getHeader();
$inf        = $hc->getInfo();
?> 

how can i make php to do something like this

if on x2.com html source php finds: 88_user_avaible_88
i want to php to show : Now you are registered ( and if i'm not asking to much , if it's posible in AJAX )
and it's a security breech if the user can see the url ( i mean http://www.x2.com/?admin_pass=admin&..._word=password )


thank you for reading this question
Last edited by cybernet : May 2nd, 2008 at 2:48 pm.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Location: Cologne, Germany
Posts: 93
Reputation: sDJh is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 8
sDJh sDJh is offline Offline
Junior Poster in Training

Re: cURL question

  #2  
May 3rd, 2008
Why should the user see the password when you access the data via PHP? Do you want to thank thet website by writing "Data from ...&password=unknown"? If not then the user doesn't see anything at all.

The PHP-Script on x2.com only needs to say "okay" or "incorrect". When accessing "okay" on your first server, then you know that the userdata where okay. Save it with Session of Cookie.
Reply With Quote  
Join Date: May 2008
Posts: 3
Reputation: cybernet is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
cybernet cybernet is offline Offline
Newbie Poster

Re: cURL question

  #3  
May 3rd, 2008
thank you for your reply
but i forgot to say that i'm noob (dumie,beginner) in php
so can you write a code for me ?
Reply With Quote  
Join Date: May 2008
Posts: 6
Reputation: jstorz is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jstorz jstorz is offline Offline
Newbie Poster

Re: cURL question

  #4  
May 10th, 2008
wow, talking about asking for a handout .... I'll pass

There are security breeches all over the place here as you are wanting to send a password through an insecure connection (http NOT https). So not showing the url is not helping or hurting.
Reply With Quote  
Join Date: May 2008
Posts: 3
Reputation: cybernet is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
cybernet cybernet is offline Offline
Newbie Poster

Re: cURL question

  #5  
May 11th, 2008
it can be made by https to

does it change something ?
Reply With Quote  
Join Date: Aug 2005
Location: Cologne, Germany
Posts: 93
Reputation: sDJh is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 8
sDJh sDJh is offline Offline
Junior Poster in Training

Re: cURL question

  #6  
May 12th, 2008
@jstorz: Every normal forum uses an insecure HTTP-connection when loggin in. Often the password is even saved uncrypted in a cookie. So when sending the password via HTTP it's not insecurer than any other website.

@cybernet: Of course you can use https. There should be an openSSL-module for PHP that you can use to crypt your request.
The problem with SSL is you need a certificate that costs you some bucks. What I do to get around is to crypt usernames and passwords with RSA or MD5. RSA can be written easily (see wikipedia for details) and MD5 is already included in PHP.

So what you do:
Page one (requester) crypts the data and sends it via HTTP to page 2. Page 2 decrypts data and looks if data are correct. If yes it just have to echo "correct". You 1st page reads "correct" and knows that the user is logged-in.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 3:56 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC