vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Hidden submital to mutliple scripts? (https://vborg.vbsupport.ru/showthread.php?t=7233)

01-25-2001 09:25 PM

I need code that will take an entry into a formbox, send a copy of that entry to one site using one name for the box, send it to another site using another name for the box, etc...

In other words, I'm trying to create one single registration page that will transparently register the user with liveuniverse.com, and Vbulletin at the same time, without renaming all the login fields on member.php.

For example the field for the username on Liveuniverse.com is named "dig.new.handle" while the field for the username on Vb is named "username".

If someone could help me with this it would be greatly appreciated. A friend suggested hidden frames, but I didn't understand his explanation.

Thanks!

-Eugene

Pertinent info:
My forum
http://techhappy.com/forums/member.p...ster&who=adult

Liveuniverse:
http://www.liveuniverse.com

01-26-2001 09:26 AM

i started a post about just the same type of thing yesterday:

http://vbulletin.com/forum/showthread.php?threadid=7216

01-26-2001 02:23 PM

i dont understand what your trying to do on your site. If they sign up it puts them in the database. I want to have a form that signs them up to multiple sites, and i dont have explicit access to the database.

01-26-2001 02:25 PM

Also, I dont want to have multiple sign ups to Vb.

I want it to sign up to Vb, a chat service, and everyone.net, all from one page.

The problem is, each of those services name the fields differently, one calls the username "username", another calls it "Dig.user", etc..

01-26-2001 02:52 PM

same here....

basically i want this for two things. 1 is exactly what you want, so that they sign up for say vbulletin and their email also goes to a mailing list script as well.

Secondly, i want to be able to put some code into someone's elses of server script (that does NOT do mysql itself with username and password) that sends some info to say register2.php (to be made) on my server that adds the info to my database?

ie.

1. user goes to http://www.friendsdomain.com
2. user fills in form to sign up for friendsdomain.com
3. form contains username and email etc.
4. presses submit
5. goes to http://www.friendsdomain.com/processform.php
----
6. Now i want that info to also be sent to http://www.mydomain.com/register.php so it can deal with it.
----
7. user sent to http://www.friendsdomain.com/thankyou.php

01-26-2001 03:00 PM

Everything you want done can be done, I just don't know the way to code it.

It will fire off a Lynx browser on your system, that updates each of those other sites

Like
http://www.blah.com/register.cgi?use...&password=blah etc

The sistes would have to all a post from outside their server on the script for it to work.

01-26-2001 04:23 PM

cool... i suppose the hidden frame thing could work like that as well creating a frame with url

http://www.domain.com/register.php?u...assword=blah.. i may see if i can do that although doing it the way you suggest would be a lot better, i will search around and see if i can find anything.

01-26-2001 04:51 PM

What I've done is simple, probably not incredibly efficient, but it works. :)

$blah = file("http://www.domain.com/script.php?arg=".urlencode($val)."&arg2=1");

Of course, this might not work if the program being used ignores variables sent through GET. :) You could do a more complex way and just emulate POST, but I'm not going to go into that.

01-26-2001 06:07 PM

Quote:

Originally posted by Ed Sullivan

$blah = file("http://www.domain.com/script.php?arg=".urlencode($val)."&arg2=1");

Uh huh, what does each part of this statement do?

01-26-2001 07:32 PM

cool ed, simplicity is best - clever

thanks

eugenie

$blah = file("http://www.domain.com/index.html")

just tells the script to download the file (in the process of course it sends the data to that server.. about to come to that).

the

?arg=blah

arg is like username=
and blah would be the actual username

now the .urelencode($val) is just to turn $val (which may be say two words into url transmittalbe information).

Make sense.

ED:

How would you do this in perl?

01-26-2001 08:18 PM

You have to use LWP.

Don't even ask. :)

01-26-2001 08:24 PM

Quote:

Originally posted by chrispadfield

$blah = file("http://www.domain.com/index.html")

just tells the script to download the file (in the process of course it sends the data to that server.. about to come to that).

then

?arg=blah

arg is like username=
and blah would be the actual username

now the .urelencode($val) is just to turn $val (which may be say two words into url transmittalbe information).

Chris:
Quote:


$blah = file("http://www.everyone.net/signup.html")

That downloads the sign up sheet for everyone.net?

Quote:


then

?arg=blah

arg is like username=
and blah would be the actual username

So, for example:

"arg" would be the name that everyone.net uses for the username form field?

"blah" would be whatever name I used for my username form field; in my sign up script?

And the script would transfer the data in the "blah" field to the "arg" field?

ED:

I think there is a " missing before 1" in arg2=1", not sure though

I'm in this program at biztech.nfte.com and they are looking into BB systems.

The only problem is biztech mainly for entrepreneurs under 18 (some under 14), so they aren't sure about the legalities. What do you know about this? If they use the COPPA form will they be free of legalities? If you get a chance could you email, or ask someone within Jelsoft to contact them? They are a possible source of a large number of licenses.

Doloresh@nfte.com, nhupert@edc.org


-Eugene (no, not Eugenie, lol)

01-26-2001 09:41 PM

you might have more problem getting this to work with something like everyone.net who might not work with this type of system. It would not be the sginup.htlm page you call anyway but the CGI or PHP or ASP whatever it is program that processes the form when someone clicks submit. I have to say i doubt it will work. This type of thing is really only going to work if you control the scripts which for everyone.net you don't. I wanted to do it for http://www.communityarchitect.com as well but i don't think i can (especially as they appear to have something preventing that as well).

01-26-2001 09:45 PM

Can't you just have it send the data to the resulting html page that is created. The sign up page?

01-26-2001 09:46 PM

Essentially fill out the fields on the everyone.net page, and the fields on the vb sign up page, and submit it, without the user knowing?

01-26-2001 09:53 PM

no :) i don't think you understand how it works.

HTML page containing form.
Visitor types in info
Submits form
Goes to script on server for processing.

that is what happens.

to get it to go to two different scripts for processing (what we want) is impossible directly (it appears). So what we do is get one of the scripts, to call the other script not as a form but using a URL. This is what ed suggests. The url will have to be done in a special way as shown to make it work. Everyone net probably won't allow their scripts to sign people up in this way (GET as opposed to POST) but you can try.

01-26-2001 10:33 PM

So if it uses GET i can have the script call http://www.site.com/signup.asp?usern...sword="qwerty"

and that will fill out and submit the username and password fields?

01-26-2001 10:44 PM

you cannot explicitly tell a script that:
form field one = form field alpha
alpha being on your page.

For example, you can't have the script take all the user's data, send it to a central file.

Then have the script take the username entry, and enter it into each field, the username entry on everyone.net, the dig.user entry on livuniverse.com, etc... and submit it?

01-26-2001 10:48 PM

what about having the other pages loaded in a hidden frame, each time the data is entered its passed along to the other frames, with the name changed appropriately for each hidden frame?

Then when the user hits submit that submits the other frames at the same time?

01-26-2001 10:48 PM

Quote:

Originally posted by Eugenie2000
So if it uses GET i can have the script call http://www.site.com/signup.asp?usern...sword="qwerty"

and that will fill out and submit the username and password fields?



yes, if it works with GET that is what I think Ed is suggesting but i havn't tried it yet. If they make you use the POST protocol then this won't work.

01-26-2001 10:52 PM

but I thought using ? just passes it to another form and doesnt allow it to be submitted. That's the impression I got from http://tech.irt.org/articles/js063/index.htm

01-26-2001 10:55 PM

How old are you? Just wondering..

01-26-2001 11:27 PM

Create a form and put some fake fields in it.
Make it's method POST.
Submit it and look at the URL.
Change it's mehtod to GET.
Submit it and look at the URL.

That's their difference.

01-27-2001 12:26 AM

I see, GET passes the values in the URL. How does POST pass the values?

01-27-2001 01:08 AM

I looked at some GET vs POST answered questions at ASKasp.com and found some answers. With GET data is unsecure and limited to 250 chars, but visible in the address bar, POST sends the data to the server which processes it?

01-27-2001 01:19 AM

yup makes sense, like replying to this thread uses post. Ed is basically saying we can use his trick only if the resulting script will allow data input by the GET method. then it will work. If it dosen't (and i am betting everyone.net dosen't) and they use only POST then, we are i think, stuck.

01-27-2001 02:03 AM

If you want to use POST (you can go get this way too), you have to use sockets: http://www.php.net/manual/en/function.fsockopen.php

01-28-2001 02:23 AM

On the side, just saw anti-trust (only plays late at nite for some reason).

I find it interesting that the head of NURV (the MS like company) looks very much like Mr. Gates.

The movie kind of creeped me out. I keep taking looks over my shoulder now and then.
You should see it.
I give it a B+.

Thank god there is a way. I guess this is sort of like my crusade to find the holy grail.

-Eugene

01-28-2001 12:41 PM

$fp = fsockopen ("www.php.net", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET / HTTP/1.0\r\n\r\n");
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}


is that what I use? Where do I insert
fopen("http://some.site.com/html/page.html","r")
?

01-28-2001 03:12 PM

Quote:


// Data to pass to the cgi script
$name = 'John Doe';
$email = 'johndoe@domain.com';
$description = 'Nice site, I love your animated gif collection!';

// Build the request string
$request = 'name=' . urlencode($name);
$request .= '&email=' . urlencode($email);
$request .= '&description=' . urlencode($msg);

// Build the header
$header = "POST /signup/signup2.php HTTP/1.0\r\n";
$header .= "Content-type: application/x-www-form-urlencoded\r\n";
$header .= "Content-length: " . strlen($request) . "\r\n\r\n";

// Open the connection
$fp = fsockopen('http://www.domain.com/', 80, &$err_num, &$err_msg, 30);
if ($fp)
{
// Send everything
fputs($fp, $header . $request);
// Get the response
while (!feof($fp))
$response .= fgets($fp, 128);
}

is what i was going to work from but so far havn't had much success, i only tried locally which dosen't work so i think i need to do it on a true domain name, will do this week sometime.

the get method worked fine with:

Quote:

$blah = file("http://localhost/signup/signup2.php?name=".urlencode($name)."&email=".urle ncode($email)."&description=".urlencode($descripti on)."");

01-28-2001 03:45 PM

Maybe these threads will help?
http://www.phpbuilder.com/mail/php3-...99806/0902.php

01-28-2001 03:49 PM

<a href="http://marc.theaimsgroup.com/?l=php-general&m=90222503032679&w=2" target="_blank">http://marc.theaimsgroup.com/?l=php-...2503032679&w=2</a>

01-28-2001 04:07 PM

<a href="http://marc.theaimsgroup.com/?l=php-general&m=90222503032679&w=2" target="_blank">http://marc.theaimsgroup.com/?l=php-...2503032679&w=2</a>

is very useful, thanks. Will try that out very soon.

01-28-2001 04:12 PM

Here is the original, with other items about it

http://www.phpbuilder.com/mail/php3-...99806/0856.php

01-28-2001 04:35 PM

Quote:

Originally posted by Eugenie2000
$fp = fsockopen ("www.php.net", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET / HTTP/1.0\r\n\r\n");
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}


is that what I use? Where do I insert
fopen("http://some.site.com/html/page.html","r")
?




have you got it working now? i have with the links you gave me, if you need help i can but i imagine you have it working now??

01-28-2001 05:12 PM

Nope, I'm not sure which script to use to accomplish what I need.

function PostToHost($host, $path, $data_to_send) {
$fp = fsockopen($host,80);
fputs($fp, "POST $path HTTP/1.1\n");
fputs($fp, "Host: $host\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
fputs($fp, "Content-length: ".strlen($data_to_send)."\n");
fputs($fp, "Connection: close\n\n");
fputs($fp, $data_to_send);
while(!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}

You would call this function with something like:

PostToHost("www.whatever.com","/cgi-bin/whatever.cgi","abc=123&def=456");


or


$fp = fsockopen ("www.php.net", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "GET / HTTP/1.0\r\n\r\n");
while (!feof($fp)) {
echo fgets ($fp,128);
}
fclose ($fp);
}


Perhaps you can email me what you did if you don't want to display it.

01-28-2001 08:49 PM

ok.

i have two scripts.

one is called signup.php and the other is called signup2.php

the idea is that signup.php is like the register script for vbulletin. It does whatever it does and then you add in a bit more to make it send the data to your other script.

The other script is signup2.php - this would perhaps be your everyone.net script etc (it is the one that you do NOT need to edit).

Anyway, this is what i added to signup.php

Quote:

PostToHost("www.ascifi.net","/post/signup2.php","name=".urlencode($name)."&email=".ur lencode($email)."&description=".urlencode($descrip tion)."");





function PostToHost($host, $path, $data_to_send) {
$fp = fsockopen($host,80);
fputs($fp, "POST $path HTTP/1.1\n");
fputs($fp, "Host: $host\n");
fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
fputs($fp, "Content-length: ".strlen($data_to_send)."\n");
fputs($fp, "Connection: close\n\n");
fputs($fp, $data_to_send);
while(!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
what this does is:

1) connects to the domain name http://www.ascifi.net
2) and finds the script url at /post/signup2.php
3) it then sends the data
name=$name
url=$url
description=$description
4) prints if it works or not.

So basically, signup.php is sending a form containing a name, email and a description field to your external script as if a webuser was doing it.

This should work for everyone.net i would think.

01-28-2001 09:47 PM

So basically I would substitute in the address of the everyone.net sign up page instead of index2.php?

Does it matter that everyone.net might use something other than php?

01-28-2001 09:59 PM

Your a scifier? Cool.

Im a trekkie, although I like andromeda more nowadays. Beltran (Q) was on andromeda, and is going to be in the next episode on monday nite. I missed the first version on Saturday. How old are you?

Anyway, this will open a socket to the site, and they will be unable to avoid this emulation, no?

Your version will send whatever $email is equal to,

put it in the form field named "email",

send whatever $username is equal to,

and put it in the form field named "username";
since "email"=$email, and "username"=$username

It will submit it to whatever script is running (whether it be Perl/CGI, PHP, ASP, etc... since the script will get the HTML end result of the PHP, Perl, or ASP script)?

chrispadfield2 01-28-2001 10:55 PM

yeah that is all correct, it will not matter if asp etc.

couple of things:

1) check out the everyone.net signup page, they may have hidden variables and stuff like that you need to incclude
2) it is NOT guaranteed to work by any stretch of the imagination. Everyone.net can prevent signups coming from outisde their domain, so that it would have to be from their page, if they did this at a server level you might not get round it, i recon you probably could though as communityarchitect.com went to quite strong measures to stop this sort of thing, see www.signup.ascifi.net to see (at the bottom you have to type in the numbers and graphics they have).

I am 19.

Sci-Fi

yeah, love it. stargate/farscape are my favourite. ST i like in moderation, andromeda.. um.. ok but Kevin Sorbo is just, i am afraid to say, corny. Suffice to say my opinions arn't hugely popular on my www.talkandromeda.com board but lots there like it. Do come and join in :)


All times are GMT. The time now is 03:22 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01338 seconds
  • Memory Usage 1,835KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete