ok theres 2 pages index.php and output.php this is Index.php <form action="output.php" method="post"> Website URL: Without "http://www." <input type="text" name="url" /><br /> Website Title: <input type="text" name="text" /> <input type="submit" /> </form> PHP: this is output.php <body> <br><br><br><center><?php include("menutop.php"); ?> <?php $url = $_POST['url']; $text = $_POST['text']; echo "Generated HyperLink: <a href="http://www.$url">$text</a>" ?> PHP: Why Does this not work?
try echo "Generated HyperLink: <a href=\"http://www.$url\">$text</a>"; or echo 'Generated HyperLink: <a href="http://www.'.$url.'">'.$text.'</a>';
Try this code : <body> <br><br><br><center><?php include("menutop.php"); ?> <? if(isset($_POST['submit'])){ $url = $_POST['url']; $text = $_POST['text']; echo "Generated HyperLink: <a href=\"http://www.$url\">$text</a>"; } else { echo '<form action="" method="post"> Website URL: Without "http://www." <input type="text" name="url" /><br /> Website Title: <input type="text" name="text" /> <input type="submit" name="submit" /> </form>'; } ?> PHP: in this wai the problem is fix and u use only 1 page