Click to See Complete Forum and Search --> : Php Script copy text to url


nikolas22t
11-20-2004, 09:48 PM
I want to add on my page a script that ask in a box a text as input and when the user press the submit button to show under a Picture that would be

http://myadress/text

(text that the user submited at the end of the url) anyone can help me?

sciguyryan
11-21-2004, 05:28 AM
I'm presuming you mean something like this:


<?php
$Page = explode("/", $_SERVER["PHP_SELF"]);
$Page = $Page[(count($Page) - 1)]
header("Location: " . $Page . $_POST["Post_Var_Here"]);
?>



RyanJ

nikolas22t
11-21-2004, 06:43 AM
I am a newbee so :) i have to ask some :P questions:)
Do i have to create a input box in html and add this in the php that you give me?

<font size="2" color="#800000">
<form action="" method="post">
<p align="center">
<input type="text" name="T1" size="20"></p>
<p align="center"><input type="button" value="Check" onClick="Post();" />
<?php
$Page = explode("/", $_SERVER["PHP_SELF"]);
$Page = $Page[(count($Page) - 1)]
header("http://www.mplampla.com/mes/ " . $Page . $_POST["T1"]);
?>
</p>
</form>
</font>

http://www.mplampla.com/email/show.JPG

The address of 2 will be http://www.mplampla.com/mes/TEXT_OF_USER

Ben Rogers
11-21-2004, 01:14 PM
<?php
$Page = explode("/", $_SERVER["PHP_SELF"]);
$Page = $Page[(count($Page) - 1)]
if (isset($_POST['T1'])) {header("http://www.mplampla.com/mes/ " . $Page . $_POST["T1"]);}
?>
<form action="" method="post">
<fieldset>
<legend>Go to...</legend>
<label for="t1">Location: </label><input type="text" name="T1" id="t1" size="20">
<input type="submit" value="Check">
</fielset>
</form>
</font>

nikolas22t
11-21-2004, 06:58 PM
not working

Ben Rogers
11-21-2004, 07:23 PM
Originally posted by nikolas22t

<?php
$Page = explode("/", $_SERVER["PHP_SELF"]);
$Page = $Page[(count($Page) - 1)] ;
if (isset($_POST['T1'])) {header("http://www.mplampla.com/mes/ " . $Page . $_POST["T1"]);}
?>
<form action="" method="post">
<fieldset>
<legend>Go to...</legend>
<label for="t1">Location: </label><input type="text" name="T1" id="t1" size="20">
<input type="submit" value="Check">
</fielset>
</form>
</font> Er, what did you change?

nikolas22t
11-21-2004, 07:25 PM
a comma at the end of the 4th line
see below to see what is my problem please

what i want to do is to create a service that show if somebody is online at msn messenger

<?php
$Page = explode("/", $_SERVER["PHP_SELF"]);
$Page = $Page[(count($Page) - 1)] ;
if (isset($_POST['T1'])) {header("http://www.mplampla.com:800/msn/ " . $Page . $_POST["T1"]);}
?>
<form action="" method="post">
<fieldset>
<legend>Go to...</legend>
<label for="t1">Location: </label><input type="text" name="T1" id="t1" size="20">
<input type="submit" value="Check">
</fielset>
</form>
</font>


my code is this now but the image is not shown when i press the button
the image would be http://www.mplampla.com:800/msn/emailaddress

(emailadreess is the text that the user added)
but is not working
e.g if the input is nikolas_try@hotmail.com the image address will be
http://www.mplampla.com:800/msn/nikolas_try@hotmail.com


WOW!! ITS NOT AN IMAGE IS A PAGE THAT IS REDIRECT TO ANOTHER PAGE...SORRY:( Can you help me? Please!!!

Paul Jr
11-22-2004, 03:28 PM
<form action="<?php echo getenv('PHP_SELF');?>" method="post" onsubmit="return false">
<fieldset><legend>Go to...</legend>
<p><label for="t1">Location: </label>
<input type="text" name="t1" id="t1"></p>
<input type="submit" name="submit">
</fieldset>
</form>
<?php
if($_POST) {
$t1 = trim($_POST['t1']);
if(!empty($t1)) {
echo '<img src="http://www.mplampla.com:800/msn/', $t1, '" alt="Image">';
} else {
echo '<p>You did not properly fill out the form.';
}
}
?>

Something like that.

nikolas22t
11-22-2004, 06:25 PM
it's not an image ...its a page that is redirecting to an image...i think i should use frames or i am wrong?