Forum Moderators: coopster

Message Too Old, No Replies

I need help!

Can't figure out a script

         

hookshot

1:48 am on Feb 9, 2008 (gmt 0)

10+ Year Member



Hi, I'm just wondering if anyone can help me.

I need to have people enter an image URL into a form and then press submit. When submit is pressed, I need to have the following output:

a text box with a pre-determined text (for example "welcome to"), then the url that was entered into the form.

So for example, if I entered www.example.com/1.jpg, then pressed submit, the output would be "Welcome to www.example.com/1.jpg."

If anyone can help, I'd really appreciate it! Thanks!

[edited by: dreamcatcher at 6:54 pm (utc) on Feb. 10, 2008]
[edit reason] Use example.com, thanks. [/edit]

freshfromseo

1:57 am on Feb 9, 2008 (gmt 0)

10+ Year Member



hello,

try this code below, this is just a simple coding for that. but it works. Hope this code of mine can help you in that prob...

<?php

if(!isset($_POST['Submit']))
{
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="<?php echo $PHP_SELF;?>">
<label>
<input type="text" name="url" />
</label>
<label>
<input type="submit" name="Submit" value="Submit" />
</label>
</form>
</body>
</html>
<?php
}
else
{
echo "Welecome to " .$_POST['url'];
}

?>

hookshot

6:31 pm on Feb 10, 2008 (gmt 0)

10+ Year Member



Perfect, thanks! :D