boy baby names - Worcester Landscaping Company - Epson Stylus Photo Printer - Cheap Car Insurance - Loan

PDA

View Full Version : Help Needed on Converting specific javascript commands to php such as math.random()


ProductivePC
May 29th 2004, 8:43 pm
I have been searching and studying for something in php that will take the place of the math.random() function in javaScript. Does anyone know of anything?

=======================================================

If you do I am also having problem with conveting the following functions from javaScript to PHP.

sc_img = new Image();
sc_img.src = sc_tracking_url;

sc_date = new Date();
sc_time = sc_date.getTime();
sc_agent = sc_agent.toUpperCase();

This is all I have left prior to testing the script. If anyone has any ideas... please let me know.

Thanks in advance.

Wayne

digitalpoint
May 30th 2004, 12:00 am
http://www.php.net/manual/en/function.rand.php should do it for ya.

ProductivePC
May 30th 2004, 12:25 am
okay I saw that but could not make out if I just left it at rand(); instead of math.random(); or did I have to include numbers inside of there....

any insight?

Also do you know of anything that will replace the following

sc_img = new Image();
sc_img.src = sc_tracking_url;

sc_time = sc_date.getTime();
sc_agent = sc_agent.toUpperCase();

------------------------------------------------------------------------
The below are correct then?
sc_date = new Date(); --> $sc_date=date('Y');
math.random(); --> rand();

thanks for any help

Wayne

digitalpoint
May 30th 2004, 12:27 am
I believe the numbers are optional, but you may want to test it to confirm.

xml
Jun 6th 2004, 3:34 am
sc_img = new Image(); --> X
sc_img.src = sc_tracking_url; --> X

I don't get what your trying to do here.
So I'm guessing something like:

$images = array("/myIMG.gif", "/anotherIMG.gif", "oneMoreIMG.gif");

foreach ($images as $image) {
echo "<p><img src=\"$image\" /></p>";
}

sc_time = sc_date.getTime(); --> date("H:i:s");
sc_agent = sc_agent.toUpperCase(); --> strtoupper("my lowercase string is now uppercase");