HighDots Forums  

Add to URL !

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Add to URL ! in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
darrenmccann101
 
Posts: n/a

Default Add to URL ! - 03-10-2005 , 11:05 AM






Hello all. This is a strange request, but is there a way of creating a Form
Text Field that when you enter a directory name eg: tempdirectory and press
enter, it will transfer you to http://www.my-domain.com/tempdirectory? Is it
best to direct the form (Action) to a php file and run a script there
(something like http://www.my-domain.com/[?textfield?]/index.htm? - please
don?t laugh, the logic is there!) If so, how should I create the script? I'm
running PHP. I?m aware that we can enter it directly into the address bar at
the top; I?m just experimenting! Thank you for your time. Darren.


Reply With Quote
  #2  
Old   
darrel
 
Posts: n/a

Default Re: Add to URL ! - 03-10-2005 , 11:10 AM






Quote:
Hello all. This is a strange request, but is there a way of creating a
Form
Text Field that when you enter a directory name eg: tempdirectory and
press
enter, it will transfer you to http://www.my-domain.com/tempdirectory? Is
it
best to direct the form (Action) to a php file and run a script there
(something like http://www.my-domain.com/[?textfield?]/index.htm? - please
don?t laugh, the logic is there!) If so, how should I create the script?
I'm
running PHP. I?m aware that we can enter it directly into the address bar
at
the top; I?m just experimenting! Thank you for your time. Darren.
Someone would have to help you with the actual PHP code, but the logic would
be:

on submit
grab form field
redirect page to 'www.mysite.com/' + formFieldString

Though, I'm not sure what, exactly, you'd use this for.

-Darrel




Reply With Quote
  #3  
Old   
darrenmccann101
 
Posts: n/a

Default Re: Add to URL ! - 03-10-2005 , 11:48 AM



Thanks Darrel, but how do I '+ formFieldString'? I'm not sure where/how to enter this!

Thank you.

Reply With Quote
  #4  
Old   
Flash Gordon
 
Posts: n/a

Default Re: Add to URL ! - 03-10-2005 , 12:33 PM



Wouldn't that just be [a href='www.my-domain.com' + myField]button[/a]?

"darrenmccann101" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Hello all. This is a strange request, but is there a way of creating a
Form
Text Field that when you enter a directory name eg: tempdirectory and
press
enter, it will transfer you to http://www.my-domain.com/tempdirectory? Is
it
best to direct the form (Action) to a php file and run a script there
(something like http://www.my-domain.com/[?textfield?]/index.htm? - please
don?t laugh, the logic is there!) If so, how should I create the script?
I'm
running PHP. I?m aware that we can enter it directly into the address bar
at
the top; I?m just experimenting! Thank you for your time. Darren.




Reply With Quote
  #5  
Old   
Joe Makowiec
 
Posts: n/a

Default Re: Add to URL ! - 03-10-2005 , 12:40 PM



On Thu 10 Mar 2005 11:05:09a, darrenmccann101 wrote in
macromedia.dreamweaver:

Quote:
is there a way of creating a Form
Text Field that when you enter a directory name eg: tempdirectory and
press enter, it will transfer you to
http://www.my-domain.com/tempdirectory? Is it best to direct the form
(Action) to a php file and run a script there (something like
http://www.my-domain.com/[?textfield?]/index.htm?
<form name="form1" method="post" action="myscript.php">
<input type="text" name="textfield">
<input type="submit" name="Submit" value="Submit">
</form>

And in myscript.php:

<?php
$mylocation = "http://www.example.com/" . $_POST['textfield'] . "/";
header("Location: $mylocation");
?>


Reply With Quote
Reply




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.