The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 23, 2019, 01:52:16 AM

Login with username, password and session length


Pages: [1] 2
  Print  
Author Topic: Need some ideas to start ...  (Read 4010 times)
NYDAz
Expert
****
Offline Offline

Posts: 212

The Night Stalker


View Profile
« on: April 15, 2009, 11:02:57 AM »

I'm just not having any ideas right now how to start a php script !

This script should fill some fields on a given website list !

Any ideas, how to start coding something like this ?

You'll be in my mind forever  Smooch
Logged

what's up?
jammaster82
Lifer
*****
Offline Offline

Posts: 666


Thats craigs list for ya


View Profile
« Reply #1 on: April 15, 2009, 02:09:01 PM »

fill some fields in on a given website list>?

Could you be little more specific about what you are trying to accomplish?
Logged

The watched pot, never boils... But if you walk away from it , the soup burns.  What gives?
NYDAz
Expert
****
Offline Offline

Posts: 212

The Night Stalker


View Profile
« Reply #2 on: April 15, 2009, 02:13:59 PM »

I have a list of websites

www.a.com
www.b.com
www.c.com
www.d.com

And on these websites is a form with the next fields :
- First Name
- Last Name

I want to write a PHP script where FirstName and LastName would be variables (ex : John Deck) and to send this information to the sites mentioned above !

 Need Help
Logged

what's up?
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #3 on: April 15, 2009, 03:48:19 PM »

You're trying to write a bot, yes?

Create your own website with a form. Post to that form and see how PHP handles it. Then create another PHP script to post to your own website and see if you can make it behave the same. Don't do it on other people's sites. It's a weird enough thing to code that it'll boggle you, even on your own system, for a while.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
NYDAz
Expert
****
Offline Offline

Posts: 212

The Night Stalker


View Profile
« Reply #4 on: April 15, 2009, 03:50:40 PM »

You're trying to write a bot, yes?
Who ... me ? NO !  Angel

Create your own website with a form. Post to that form and see how PHP handles it. Then create another PHP script to post to your own website and see if you can make it behave the same. Don't do it on other people's sites. It's a weird enough thing to code that it'll boggle you, even on your own system, for a while.
Nice ideas ... like always ... thanks perkiset  Praise
Logged

what's up?
vsloathe
vim ftw!
Global Moderator
Lifer
*****
Offline Offline

Posts: 1669



View Profile
« Reply #5 on: April 15, 2009, 07:09:06 PM »

You'll need to use a browser emulation library, like cURL.

Many of the scripts I've posted here and at Syndk8 are good examples of how to use cURL.
Logged

hai
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #6 on: April 15, 2009, 07:10:24 PM »

Not necessarily. the webRequest class I posted is an excellent way to start, if less horse-powered than cURL. It's all I use FWIW.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Bompa
Administrator
Lifer
*****
Offline Offline

Posts: 564


Where does this show?


View Profile
« Reply #7 on: April 15, 2009, 07:56:35 PM »

I'm just not having any ideas right now how to start a php script !

This script should fill some fields on a given website list !

Any ideas, how to start coding something like this ?

You'll be in my mind forever  Smooch

1. Write a small block of code that will fetch (and save to your pc), the homepage of the target site.

2. Open that file with your text editor and find the link to signup page.

3. Write a small block of code that will fetch (and save to your pc), the signup page of the target site.

4. Open that file with your text editor and find the form (or maybe another link to follow).

5. Copy and paste from <form to </form from that page into your text editor.

6. Stare at that until you turn gay.

Wink



Logged

"The most beautiful and profound emotion we can experience is the sensation of the mystical..." - Albert Einstein
vsloathe
vim ftw!
Global Moderator
Lifer
*****
Offline Offline

Posts: 1669



View Profile
« Reply #8 on: April 16, 2009, 08:21:09 AM »

Not necessarily. the webRequest class I posted is an excellent way to start, if less horse-powered than cURL. It's all I use FWIW.

Tomato tomato.

As far as he's concerned they're roughly the same thing.
Logged

hai
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #9 on: April 16, 2009, 08:43:53 AM »

... except that it's all PHP, which he's trying to learn - I simply suggest that more transparency and code to read is a good thing. cURL can be a bit weird for the uninitiated.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
NYDAz
Expert
****
Offline Offline

Posts: 212

The Night Stalker


View Profile
« Reply #10 on: April 16, 2009, 10:51:31 AM »

@vsloathe - I should take a look at cURL  Nerd

@perkiset - You're right ... I should use your webRequest class 2.1 - right ?  Huh?

@Bompa - Nice tips  Wink

Now let's get to work 
« Last Edit: April 16, 2009, 10:57:13 AM by NYDAz » Logged

what's up?
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #11 on: April 16, 2009, 11:02:49 AM »

@perkiset - You're right ... I should use your webRequest class 2.1 - right ?  Huh?

If you're into it, take one of the latest releases and give'r a shot. There were some troubles with chunking and pipelining, as I recall, but these should not be issues for you as you get started.

Also, caveat: it does not work perfectly on all URLs. There are some sites that give it trouble and vice-versa. It is an excellent tool for you to do your own trial and error, and to get your arms around how the entire process of forms/posting/handling form data etc work, but not necessarily the best tool for a large, production spider or bot unless you know what you're doing.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
NYDAz
Expert
****
Offline Offline

Posts: 212

The Night Stalker


View Profile
« Reply #12 on: April 16, 2009, 12:43:51 PM »

So I can accept ALL words if you want ! You can say ... man your stupid ... wtf is so simple ... fuck off ... because I'll say "I don't give a fuck, I want to learn with all prices  Nerd " if the expression is correct  Huh?

I've begined to wrote my bot  ROFLMAO !

Code:
<?php
include 'perkiset-class.php';
$url "http://www.thisisjustatest.com/";
$title "This is just a TEST";
$email "test@test.com";
$category "Miscellaneous";
?>


I've captured the form on my localhost, like Bomps said ! I will try it on my website FIRST to see what's the move 

Now what to wrote next in my script ...  D'oh!

Any clues ? Even if they are very small Smiley
Logged

what's up?
NYDAz
Expert
****
Offline Offline

Posts: 212

The Night Stalker


View Profile
« Reply #13 on: April 16, 2009, 01:57:32 PM »

For the momment I'm not using your class perk because I don't know how  Huh?

I've tried with a little curl script

Code:
<?php
$ch 
curl_init("http://www.example.com/form.php");
curl_setopt($chCURLOPT_POSTtrue);
curl_setopt($chCURLOPT_POSTFIELDS,"url=http://www.thisisjustatest.com&title=TEST&email=test@test.ro&section=Computers");
curl_setopt($chCURLOPT_FOLLOWLOCATIONtrue);
curl_setopt($chCURLOPT_USERAGENT,"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3");
curl_setopt($chCURLOPT_HEADERfalse);
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
echo 
curl_exec($ch);
curl_close($ch)
?>


The fields name are exactly how they should be !

I'm getting this error :
Some of the fields are too short or missing.

Focus ... focus ... focus you stupid boy  D'oh!
Logged

what's up?
NYDAz
Expert
****
Offline Offline

Posts: 212

The Night Stalker


View Profile
« Reply #14 on: April 16, 2009, 02:04:43 PM »

I'm getting this error :
Some of the fields are too short or missing.
I've managed to put my link  Grin

The error was title was too short !

    

Hmmm ... now another questions ... how can i set the $ch = curl_init to retrive urls from a file ?  Need Help
Logged

what's up?
Pages: [1] 2
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!