• Welcome to ForumKorner!
    Join today and become a part of the community.

Php help

Nulled

Onyx user!
Reputation
0
Hay folks a friend sent this to my its some sort of verifier for tublr
if user name is valid or not.
is there a way to modify so it opens up a txt file and tests many
thanks any help you give

<?php
$username = "hh";

$url="http://"$username".tumblr.com";

$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 20);
curl_setopt($ch, CURLOPT_NOBODY, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_exec($ch);
$header = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if( $header == "404" )
{
echo not found
}else{
echo valid
}
 

OliverE

Power member.
Reputation
0
If your happy to make a MySQL database with all the usernames in then, sure I know how.
You would just set up a while look and test the connection for each row.
 

Nulled

Onyx user!
Reputation
0
i have been messing around with this code
but not working iam sure theres a way for
php to load list to check

<?php
$file = fopen("test.txt","r");

//some code to be executed

fclose($file);
?>

but no luck at all
 

OliverE

Power member.
Reputation
0
You will have to output whether the username is valid or not somewhere and it would be easier just adding a value to a database then editing a file tbh.
 

Nulled

Onyx user!
Reputation
0
i see i never messed around with databases and such have to learn this could be my first time could you point me in the right way to setup MySQL database and files needed iam running on ubuntu at moment
 

Nulled

Onyx user!
Reputation
0
no dont have hosting i was going to run it from local
i will get hosting next week if thats what i will need
as iam sure it will be easyier with it host+cpanel
 

itzDecon

Member
Reputation
0
The last thing you want is to store usernames in a .TXT file. That's very insecure, your best chance would be to use a MySQL Database, helps a lot more than anything else.