|
Your time now: Mon Nov 23, 2009 8:14 am
|
View unanswered posts | View active topics
| Author |
Message |
|
kame
|
Post subject: Text Box that changes current URL Posted: Wed Jul 18, 2007 4:39 pm |
|
Joined: Wed Jul 18, 2007 4:30 pm Posts: 13
|
|
I know just about nothing of HTML. Last night, I was trying for hours to make a text box that when you type something and hit submit, it changes the current url to ____.com/(whatever you typed).html
My code looks like this:
<FORM ACTION="">
Your Answer: <INPUT answer="">
<input type="image" name="submit" src="http://www.idiotsguidetowebmarketing.com/images/cool_arrow_v.gif" />
</FORM>
Whenever someone types something in, it tacks on ?=(what was typed in) to the end of the web address. I am not allowed to have ? or = in the address. How do I get it to say (answer).html. When I put ".html" after form action, it just adds .html?=(what was typed in)
Please help, I hardly know anything about HTML
|
|
| Top |
|
 |
|
flabbyrabbit
|
Post subject: Posted: Wed Jul 18, 2007 10:46 pm |
|
 |
| 500+ Club |
 |
Joined: Thu Jan 25, 2007 2:10 pm Posts: 691 Location: Midlands, England
|
You would need to use somthing else, e.g. javascript. you would need to change the form submit button to:
Code: <input type="image" name="submit" onClick="Change()"
You will need to have a quick look at javascript but it should be fairly straight forward.
Flabby Rabbit
_________________ http://www.hackthis.co.uk
|
|
| Top |
|
 |
|
kame
|
Post subject: Posted: Sat Jul 21, 2007 4:36 am |
|
Joined: Wed Jul 18, 2007 4:30 pm Posts: 13
|
|
I've been trying for soo long. What goes in Change()? How do I just make it redirect to whatever was put into the box?
|
|
| Top |
|
 |
|
flabbyrabbit
|
Post subject: Posted: Sat Jul 21, 2007 8:31 pm |
|
 |
| 500+ Club |
 |
Joined: Thu Jan 25, 2007 2:10 pm Posts: 691 Location: Midlands, England
|
|
you could put what ever you wanted in the onClick property. It will have to link to a javascript function. Google for a peice of javascript code that will redirect the page. Then when you click the button you want it to perform the peice of javascript, so will need to be linked to the function.
I will write you some code as soon as i can, then i will post it for you.
Flabby Rabbit
_________________ http://www.hackthis.co.uk
|
|
| Top |
|
 |
|
DDragon
|
Post subject: Posted: Sun Jul 22, 2007 11:15 am |
|
 |
| 50+ Club |
Joined: Wed Jun 20, 2007 1:51 am Posts: 91 Location: Australia
|
kame, try this for your form:
Code: <form name="frmUrl" method="post" action="url.pl"> Your url: <input type="text" name="txtUrl"> <input type="image" src="manual.jpg" name="submit"> </form>
thats the form (basically) if you need help with the perl program ill post it for you if you like
_________________ I put everything down to this: EWIT (Everything Works In Theory)
|
|
| Top |
|
 |
|
kame
|
Post subject: Posted: Mon Jul 23, 2007 7:18 pm |
|
Joined: Wed Jul 18, 2007 4:30 pm Posts: 13
|
|
Cool! Now it changes the end to just "url.pl" and no more ? or =! I just need to know how to make whatever you typed appear in the url. I thought it was ('txturl'), but that isn't working.
|
|
| Top |
|
 |
|
DDragon
|
Post subject: Posted: Tue Jul 24, 2007 12:37 pm |
|
 |
| 50+ Club |
Joined: Wed Jun 20, 2007 1:51 am Posts: 91 Location: Australia
|
ok what we need to do now is make the Perl script (url.pl)
ill post what you need...
Code: #!/usr/bin/perl -T # url.pl # Anthony Gilbert (AKA DDragon)
use CGI ':standard';
my $address, $url;
$address = param('txtUrl'); $url = "http://www." . $address . ".com";
print "Location: $url\n\n";
with this code place it in the cgi-bin directory on your webserver and make sure that before you paste and save the file that the 'txtUrl' matches the exact way it is typed here: Code: <form name="frmUrl" method="post" action="url.pl"> Your url: <input type="text" name="txtUrl"> <input type="image" src="manual.jpg" name="submit"> </form>
_________________ I put everything down to this: EWIT (Everything Works In Theory)
Last edited by DDragon on Sun Aug 05, 2007 8:57 am, edited 1 time in total.
|
|
| Top |
|
 |
|
kame
|
Post subject: Posted: Tue Jul 24, 2007 4:00 pm |
|
Joined: Wed Jul 18, 2007 4:30 pm Posts: 13
|
|
I copied that both codes and put them in the proper places exactly as you had shown, but it still does url.pl. Am I supposed to customize things in the perl script? I pasted it into a blank file in cgi-bin and named it url.pl.
I hardly know anything about scripting, thank you for being patient.
|
|
| Top |
|
 |
|
DDragon
|
Post subject: Posted: Sat Jul 28, 2007 4:32 pm |
|
 |
| 50+ Club |
Joined: Wed Jun 20, 2007 1:51 am Posts: 91 Location: Australia
|
|
ok have you got this up on a webserver or is it a local site (ie do you use WAMP or something like it to look at your site on your computer?)
_________________ I put everything down to this: EWIT (Everything Works In Theory)
|
|
| Top |
|
 |
|
kame
|
Post subject: Posted: Sun Jul 29, 2007 3:03 am |
|
Joined: Wed Jul 18, 2007 4:30 pm Posts: 13
|
|
I don't know. Is filemanager a method? It's tripod.
|
|
| Top |
|
 |
|
DDragon
|
Post subject: Posted: Sun Jul 29, 2007 9:04 am |
|
 |
| 50+ Club |
Joined: Wed Jun 20, 2007 1:51 am Posts: 91 Location: Australia
|
|
ok so you have a webhost. what is the address of your site? ill be able to take a look at it then
_________________ I put everything down to this: EWIT (Everything Works In Theory)
|
|
| Top |
|
 |
|
kame
|
Post subject: Posted: Sun Jul 29, 2007 4:41 pm |
|
Joined: Wed Jul 18, 2007 4:30 pm Posts: 13
|
|
| Top |
|
 |
|
DDragon
|
Post subject: Posted: Mon Jul 30, 2007 1:25 pm |
|
 |
| 50+ Club |
Joined: Wed Jun 20, 2007 1:51 am Posts: 91 Location: Australia
|
|
when you edit your site do you use an FTP program like FileZilla, or do you use the tripod file manager page?
_________________ I put everything down to this: EWIT (Everything Works In Theory)
|
|
| Top |
|
 |
|
kame
|
Post subject: Posted: Mon Jul 30, 2007 4:28 pm |
|
Joined: Wed Jul 18, 2007 4:30 pm Posts: 13
|
|
Either the tripod file manager page, or the way where you just click an edit button and it lets you type something right onto the page.
|
|
| Top |
|
 |
|
DDragon
|
Post subject: Posted: Wed Aug 01, 2007 10:23 am |
|
 |
| 50+ Club |
Joined: Wed Jun 20, 2007 1:51 am Posts: 91 Location: Australia
|
|
I took a look at your pages code and as far as i can tell there is not form, without the form the perl script wont work place the text box in the form i made for you and then try it...
Edit: i was looking through my own archive of scripts and such and found one that you might benifit from.. its a piece of JavaScript that i wrote ages ago ill post it for you when i relocate it
_________________ I put everything down to this: EWIT (Everything Works In Theory)
|
|
| Top |
|
 |
Who is online |
Users browsing this forum: No registered users and 3 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|
|