Jump to content

Recommended Posts

Ok I am making a form that the user inputs the following:

 

 

URL (input type=text name=url)

HEIGHT (input type=text maxchars=3 name=height)

WIDTH (input type=text maxchars=3 name=width)

Number (input type=text name=number) of times to display per refresh

 

The form will be using GET and processed on the same page

 

That field "Number" is the field that I want to set for the number of times to run foreach OR it will be the number of times to place "URL" into an arrray

 

so if someone puts 5 it will either display URL 5 times or put "URL" in the same array 5 times please let me know if i am explaining this clear enough or not.

 

-John

 

 

 

Ok Neither of those codes are working i am not getting errors though

 

the url i tested it with is this:

http://jnerocorp.com/for.php?url=http://google.com&?number=2

 

 

this is the Code I am using


<?php
if(isset($_GET['number']) && is_int($_GET['number']))  {

$number = $_GET['number'];
$url = $_GET['url'];

for ($i = 0; $i < $number; $i++) {
    echo "$url <br>";
}

}
?>

 

 

-john

is this the code you are currently using, exactly as seen below:

 

<?php
if(isset($_GET['number']) && is_int($_GET['number']))  {

$number = $_GET['number'];
$url = $_GET['url'];

for ($i = 0; $i < $number; $i++) {
    echo "$url <br>";
}

}
?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.