Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 05-27-2003, 04:49 AM   #1
3Xguru
Confirmed User
 
Join Date: Sep 2001
Location: Iasi
Posts: 1,281
PHP help needed. Any experts?

I'm working on a script that fills out forms automaticaly.
The form url's are stored in a database, and I need to submit the variables to the forms using the post method.
The problem is that I do not know how to automaticaly submit the forms in php(without pressing a button for each form)

The code would look something like this:
PHP Code:
<?php

for($i=1;$i<10;$i++){
$url_form="http://www.anotherserver.com/form".$i.".php";
$name="John";
}
?>
How do I submit the variable $name to all 10 external forms in the loop using the POST method?
__________________
-=Free Webmaster Tools=-
3Xguru is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-27-2003, 04:51 AM   #2
Libertine
sex dwarf
 
Libertine's Avatar
 
Join Date: May 2002
Posts: 17,860
Open a socket connection, send the proper HTTP request, close the socket.
__________________
/(bb|[^b]{2})/
Libertine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-27-2003, 04:54 AM   #3
3Xguru
Confirmed User
 
Join Date: Sep 2001
Location: Iasi
Posts: 1,281
How do I do it? With the socket...
Can you post an simple example.
I have been trying to find a solution on Google for hours and my head hurts
__________________
-=Free Webmaster Tools=-

Last edited by 3Xguru; 05-27-2003 at 04:59 AM..
3Xguru is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-27-2003, 04:55 AM   #4
Libertine
sex dwarf
 
Libertine's Avatar
 
Join Date: May 2002
Posts: 17,860
http://php.net/manual/nl/function.fsockopen.php
Read this.
__________________
/(bb|[^b]{2})/
Libertine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-27-2003, 04:57 AM   #5
Libertine
sex dwarf
 
Libertine's Avatar
 
Join Date: May 2002
Posts: 17,860
And here's an example from that page which might be helpful (no, I am lazy today, so I won't write you some custom code):

PHP Code:
//create a string with all the posted data...

foreach ($HTTP_POST_VARS as $key => $value) {
$value urlencode(stripslashes($value));
 
$req .= "&$key=$value";
}

//create headers...

$header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= 'Content-Length: ' strlen($req) . "\r\n\r\n";
$fp fsockopen ('www.paypal.com'80$errno$errstr30);

if (!
$fp) {
 
// ERROR
 
echo "$errstr ($errno)";
} else {

//put the data..
 
fputs ($fp$header $req);
 while (!
feof($fp)) {
//read the data returned...
   
$res fgets ($fp1024);

}
 
fclose ($fp);

__________________
/(bb|[^b]{2})/
Libertine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-27-2003, 05:08 AM   #6
3Xguru
Confirmed User
 
Join Date: Sep 2001
Location: Iasi
Posts: 1,281
Thanks punkworld

You really helped me a lot!
__________________
-=Free Webmaster Tools=-
3Xguru is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.