[Solved] How to add query to my URL? [closed]


@lily … saw your message before I left. This code will create a file. Hope this sorts you out 🙂

<form action="#" method="post">
  Number start:<br>
  <input type="text" name="num_start" value="1">
  <br>
  Number end:<br>
  <input type="text" name="num_end" value="5">
  <br><br>
  <input type="submit" value="Submit">
</form> 


<?php

try{

    if (isset($_POST['num_start']) && isset($_POST['num_end'])){

        $i = $_POST['num_start'];
        $e = $_POST['num_end'];

        while ($i <= $e){
            echo "<a href="http://mywebsite.com?$i.php">http://mywebsite.com?$i.php</a><br/>";

            $file_name = $i.'.php';
            $handle = fopen($file_name, 'w') or die('Cannot open file:  '.$file_name);
            $data = $i.'.php';
            fwrite($handle, $data);


        $i++;
        }
    }

} catch (Exception $e) {
    echo 'FAILED: Exception: ',  $e->getMessage(), "<br/>";
}
?>

JUST UPDATED AGAIN… THIS WILL PLACE TEXT INSIDE EACH FILE NOW.

3

solved How to add query to my URL? [closed]