http request

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

cybernet
Forum Newbie
Posts: 12
Joined: Tue Apr 29, 2008 1:29 am
Contact:

http request

Post by cybernet »

i want to create a user for a program
but for that i need the script to make a http request in the background without the user seeing the address or domain

and when the user is looking at the page source in browser i don't want to see the address

is it possible :?:

thank you :drunk:
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: http request

Post by Kieran Huggins »

short answer: You're going about this the wrong way.

long answer: you could find a way of making it really hard for people to figure out the address and what you're doing, but you should definitely think about your business req's some more.
cybernet
Forum Newbie
Posts: 12
Joined: Tue Apr 29, 2008 1:29 am
Contact:

Re: http request

Post by cybernet »

Kieran Huggins wrote:short answer: You're going about this the wrong way.

long answer: you could find a way of making it really hard for people to figure out the address and what you're doing, but you should definitely think about your business req's some more.
can you give me an advice :?: :cry:

later edit:
i want to be more precisely
i want the php to access in the background a page
with the addres

Code: Select all

http://domain.88/add_user?id=<?php " .$cfun_id. "?>&password=<? ".$password."?>

i think i write the code good 8O
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: http request

Post by Kieran Huggins »

We'd be able to give you better advice with more info about what you're trying to do, exactly.

Case example?
cybernet
Forum Newbie
Posts: 12
Joined: Tue Apr 29, 2008 1:29 am
Contact:

Re: http request

Post by cybernet »

so
first of all i'm very hard to explicate because i don't speak english very well
i have a page
register.html

Code: Select all

<form action="register.php" method="post"> 
 
<form>
 
Type you CFun! ID:<br /> 
 
<input type="text" name="cfun_id">
 
<br>
 
Your Name: <br />
 
 
<input type="text" name="name"><br />
Choose a password please:<br />
<input type="password" name="pass_word"><br />
 
 
<input type="submit" />
 
</form>
register.php

Code: Select all

$cfun_id= $_POST['cfun_id'];
 
$name = $_POST['name'];
$pass_word = $_POST['pass_word'];
in the code of register.php is missing the http request
something like

Code: Select all

http://example.com/plugins/user_reg_del ... &username=<? " .$cfun_id."?>&password=<? ".pass_word."?>&name=<? ".name."?>
and if i mentioned this, the answer of the request has 6 answers

Code: Select all

IllegalArgumentException
UserNotFoundException
UserAlreadyExistsException
RequestNotAuthorised
UserServiceDisabled
ok

if get response like UserAlreadyExistsException on register page i want to show up
THIS USERNAME IS ALREADY REGISTERED
if get response like ok on register page i want to show up
Have Fun on cyberfun now you are registered

later edit:
and i can't make a mysql_query because the password has a hash that can't be implemented in php
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: http request

Post by Kieran Huggins »

the second <form> tag is likely causing you some problems
cybernet
Forum Newbie
Posts: 12
Joined: Tue Apr 29, 2008 1:29 am
Contact:

Re: http request

Post by cybernet »

Kieran Huggins wrote:the second <form> tag is likely causing you some problems
i just give an exemple
do you help me or not
or just watching at hot the cool is the font i write it ?? :dubious:
cybernet
Forum Newbie
Posts: 12
Joined: Tue Apr 29, 2008 1:29 am
Contact:

Re: http request

Post by cybernet »

guess not :cry:
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: http request

Post by Kieran Huggins »

:dubious:
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: http request

Post by Christopher »

If you want to make additional requests in the background -- use the cURL library, or for PHP4 use the Snoopy class.
(#10850)
cybernet
Forum Newbie
Posts: 12
Joined: Tue Apr 29, 2008 1:29 am
Contact:

Re: http request

Post by cybernet »

Kieran Huggins wrote::dubious:
what is suppose to mean ?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: http request

Post by RobertGonzalez »

@cybernet I think we might be having a hard time understanding your English. I apologize for this.

Can you explain again what exactly you are trying to do and why it requires a background request that your user cannot see in order to do what you want?
cybernet
Forum Newbie
Posts: 12
Joined: Tue Apr 29, 2008 1:29 am
Contact:

Re: http request

Post by cybernet »

now i can do the background request with cURL from php
Everah wrote:@cybernet I think we might be having a hard time understanding your English. I apologize for this.

Can you explain again what exactly you are trying to do and why it requires a background request that your user cannot see in order to do what you want?
the reason is because it's a security breech, the url contains a password and if you have that password
anyone can add and delete users
when php access that url he (php) will get a reponse
like: ok ,userAlreadyExists, etc.


how can i make php when he will get response like UserAleardyExists
php should execute
echo " Please choose another username ";
and if get answer like ok
php should execute
echo " Now you are registered , Have Fun On CyBerFun ";
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: http request

Post by RobertGonzalez »

Password should never be sent by GET. cURL allows sending POST data rather easily so that is how I would suggest you POST information.

My bigger question is why does this need to happen in the background? Why can this not happen like all other sign up/registration pages that handle this all per page request?
cybernet
Forum Newbie
Posts: 12
Joined: Tue Apr 29, 2008 1:29 am
Contact:

Re: http request

Post by cybernet »

cybernet wrote:and i can't make a mysql_query because the password has a hash that can't be implemented in php
got a better idea :|

because i don't now another solution :banghead: :banghead: :?
Post Reply