Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 2219 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

need some help

Thread title: need some help
Closed Thread    
    Thread tools Search this thread Display Modes  
03-02-2008, 01:13 PM
#1
ryanwelsh is offline ryanwelsh
Status: Junior Member
Join date: Jan 2008
Location:
Expertise:
Software:
 
Posts: 74
iTrader: 1 / 100%
 

ryanwelsh is on a distinguished road

  Old  need some help

Hi I have 100+ proxies and I am looking to create a website that has a button on it that when pressed will show a url to one of my proxys, one selected at random. I have a slight bit of kowledge with php, and I know this would not be complex at all so could someone give me a few lines of code for it.

03-02-2008, 01:49 PM
#2
Toad is offline Toad
Status: Junior Member
Join date: Dec 2004
Location:
Expertise:
Software:
 
Posts: 67
iTrader: 3 / 100%
 

Toad is on a distinguished road

  Old

PHP Code:
<?
if (isset($_POST['getproxy'])):

$urlbank "urlbank.txt";
$urls file_get_contents($urlbank);
$proxies explode("\n"$urls);
$random rand(1,count($proxies))-1;
$proxy $proxies[$random];

echo 
"<a href='$proxy>$proxy</a>";

else:
?>
Hi there! Welcome to our awesome proxy network.
<br />
What are you waiting for? Click below and begin your anonymous browsing today!
<form method="post" action="whatever.php"><input type="submit" name="getproxy" value="Proxify Me!"></form> 
<?
endif;
?>
Files needed:
whatever.php
urlbank.txt (Just put a new url on each line...)

That seems to get the job done in a simple fashion, and might be of some help

03-06-2008, 02:44 PM
#3
VernonK is offline VernonK
VernonK's Avatar
Status: Junior Member
Join date: Jan 2007
Location: Western Maryland
Expertise:
Software:
 
Posts: 39
iTrader: 0 / 0%
 

VernonK is on a distinguished road

Send a message via MSN to VernonK

  Old

Or... you could pretty much do the same thing that Toad suggested except for without a form. You could read all the proxy's and then pull a random one (Toad shows you how above) and instead of putting a form you could just create a simply text link like "Visit a Random Proxy!"

Again, Toad's code above pretty much shows you how to do it, I would just skip the form unless it's really needed. My goal is to always simplify the approach as much as possible to require as few steps as posssible.

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed