Current location: Hot Scripts Forums » General Web Coding » HTML/XHTML/XML » open link with text box


open link with text box

Reply
  #1 (permalink)  
Old 07-06-07, 02:39 AM
keondas keondas is offline
New Member
 
Join Date: Jul 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation open link with text box

Hi

I think this is very easy to do but I havent got it to work, I need to set a text box area with an open button where the user can type hes account number only that its the number off the folder in the server, and open that same url for example the box will be in http://www.yoursite.com/index.php and if the user types in the box 12254 it opens the url http://www.yoursite.com/12254

please helpp!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 07-06-07, 05:46 AM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
You could do it this way, but you would have to use Javascript.
There may be another way to use just PHP, but I will have to think about it.
PHP Code:

<div>

<?php
$folder_name 
$_POST["folder_name"];
$path "http://your_site.com/";
$dest $path.$folder_name;
?>
<span style="border:1px solid #000000;width:332px;padding-top:15px;padding-left:15px;">
<form name="theForm" action="#" method="POST">
<b>Enter account # :</b> <input name="folder_name">
<input type="submit" value="Go">
</form>
</span>
<?php if(isset($folder_name)) { ?>
<script>
document.theForm.action="<?php echo $dest ?>";
theForm.submit();
</script>
<?php ?>
</div>
Ok, here is a PHP only solution.

This PHP code MUST go at the top of your page with absolutely no spaces, blank lines or any text of any kind before it.

Make sure that you understand this or the code will not work.
PHP Code:

<?php

$folder_name 
$_POST["folder_name"];
$path "http://your_site.com/";
$dest $path.$folder_name;
if(isset(
$folder_name) && $folder_name != "") {header("Location: $dest");}
?>
And the form can go anywhere else that you like on your page.
HTML Code:
<span style="border:1px solid #000000;width:332px;padding-top:15px;padding-left:15px;">
<form action="#" method="POST">
<b>Enter account # :</b> <input name="folder_name">
<input type="submit" value="Go">
</form>
</span>
__________________
Jerry Broughton
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 07-06-07, 02:37 PM
keondas keondas is offline
New Member
 
Join Date: Jul 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks

Man !! you save my life

Thanks!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Draggable Tables Ares JavaScript 10 08-03-06 07:55 AM
Xml / Dom / Css Mark_SC.SE JavaScript 0 06-29-05 09:05 AM
picking random entries with a filter... Double selection problem dsumpter PHP 7 11-16-03 08:19 PM


All times are GMT -5. The time now is 07:00 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.