Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript random redirect
    primarykey
    data
    text
    <p>so my situation is as follows:</p> <p>I wrote a submission system in php that writes to a textfile rather than a database, the idea of the system is people submit their url to the textfile and then when that script is called on a page, it redirects to a random address out of the textfile; the problem is, I don't know how to make javascript read from the text file and then pick a line to redirect to.</p> <p>Actually, just to clarify, I know how to make javascript read from the text file; but I have NO idea how id write a function to pick a url from the file and forward to it.</p> <p>Seeing as I hit this road block a couple of days ago, the only way I have been handling submissions is checking the text file every 12 hours for new submissions and then manually adding them to this code:</p> <pre><code>setTimeout(function() { var howMany = 38; var page = new Array(howMany+1); page[0]="http://gproxy.nl/"; page[1]="http://homeproxy.me/"; page[2]="http://proxyturbo.com/"; page[3]="http://www.lblocker.info/"; page[4]="http://goprivate.eu/"; page[5]="http://jsproxy.com/"; page[6]="http://openthis.eu/"; page[7]="http://proxy4home.info/"; page[8]="http://dedicatedipaddress.net/"; page[9]="https://www.4everproxy.com/"; page[10]="http://www.surfsearch.info/"; page[11]="http://www.leaveproxy.com/"; page[12]="http://proxyecole.fr/"; page[13]="http://newipnow.com/"; page[14]="http://www.hiddenmode.info/"; page[15]="https://europrox.org/"; page[16]="https://www.4everproxy.com/"; page[17]="https://goingthere.org/"; page[18]="http://xuxor.com/"; page[19]="http://033b.com/"; page[20]="http://thewebtunnel.com/"; page[21]="http://prox.phanteye.com/"; page[22]="http://www.hiddenall.info/"; page[23]="http://www.5966.info/"; page[24]="http://hideyoself.com/"; page[25]="http://prox.phanteye.com/"; page[26]="http://freevideoproxy.com/"; page[27]="http://thewebtunnel.com/"; page[28]="http://openthis.eu/"; page[29]="https://europrox.org/"; page[30]="http://xuxor.com/"; page[31]="https://incloak.com/"; page[32]="http://www.leaveproxy.com/"; page[33]="http://www.openunblocker.com/"; page[34]="http://post48.com"; page[35]="http://post48.com"; page[36]="http://inteproxy.com"; page[37]="http://208.73.23.59"; page[38]="http://hidemetoday.com/"; function rndnumber(){ var randscript = -1; while (randscript &lt; 0 || randscript &gt; howMany || isNaN(randscript)){ randscript = parseInt(Math.random()*(howMany+1)); } return randscript; } quo = rndnumber(); quox = page[quo]; window.location=(quox); }, 1500); </code></pre> <p>I would be very grateful if someone would help me write the script or tell me what kind of function I should be googling to look up, googling "How to make javascript read from a textfile and redirect" doesn't really turn up much ; (</p> <p>Many thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload