Web Design and Development Forums

submit part of a url through a text box

This is a discussion on "submit part of a url through a text box" within the HTML Forum section. This forum, and the thread "submit part of a url through a text box are both part of the Design Your Website category.


Go Back   Webforumz.com > Design Your Website > HTML Forum

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Apr 10th, 2008, 23:38   #1 (permalink)
Junior Member
 
Join Date: Aug 2007
Location: London
Posts: 13
submit part of a url through a text box

Hi

Can anyone help. I have a website that I want people to use to access their website's statistics by simply entering their domain name into a text box, click submit and be taken to their statistics page.

For example
Someone has the domain name cats.co.uk. So they enter 'cats.co.uk' into the text box, click submit and it loads up http://cats.co.uk/statistics

Every domain name's statistics url is set up the same way. eg http://domainname/statistics

Does anyone know how I could do this? Please dont worry about security issues. Id rather a solution that uses html (and php if need be). Im trying to avoid Javascript (if possible) and setting up a database to store domain names.

I look forward to your answers
Thanks
Mark
markusdavid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 11th, 2008, 00:05   #2 (permalink)
Up'n'Coming Member
 
Join Date: Mar 2008
Location: Chester, UK
Age: 17
Posts: 87
Re: submit part of a url through a text box

Oh nvm, i think i mis-understood.

A quick google returned this to go to a url, just needs a little tinker.

Quote:
<form name="openlocation">
<input type="text" name="href" value="http://">
<input type="button" value="Go To" onClick="location.href=document.openlocation.href. value;; ">
</form>
I'm off to bed, if no one else replies i'll show you tomorrow

Last edited by Bocaj; Apr 11th, 2008 at 00:37. Reason: Mis understood
Bocaj is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 11th, 2008, 07:23   #3 (permalink)
Junior Member
 
Join Date: Aug 2007
Location: London
Posts: 13
Re: submit part of a url through a text box

Thanks Bocaj,
Its a start! Further than I got!
markusdavid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 11th, 2008, 15:32   #4 (permalink)
Junior Member
 
Join Date: Aug 2007
Location: London
Posts: 13
Re: submit part of a url through a text box

Has anyone got any ideas???
markusdavid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 11th, 2008, 16:35   #5 (permalink)
Chief Moderator
 
aso186's Avatar
 
Join Date: Oct 2007
Location: UK
Posts: 701
Blog Entries: 2
Send a message via Skype™ to aso186
Re: submit part of a url through a text box

Code: Select all
<form name="openlocation">
<input type="text" name="href" value="http://">
<input type="button" value="Go To" onClick="location.href=document.openlocation.href.value + /statistics/;">
</form>
__________________

aso186 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 11th, 2008, 18:15   #6 (permalink)
Junior Member
 
Join Date: Aug 2007
Location: London
Posts: 13
Re: submit part of a url through a text box

Thank you moderator, that is really helping and it works great! In terms of enhancing it:
Is there anyway of having the 'http://' hidden?
And an error message to appear should they enter their domain wrongly?

Thanks
Mark
markusdavid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 11th, 2008, 21:35   #7 (permalink)
Up'n'Coming Member
 
Join Date: Mar 2008
Location: Chester, UK
Age: 17
Posts: 87
Re: submit part of a url through a text box

sorry for not getting back to it sooner... been busy today

Code: Select all
<form name="openlocation">
<input type="text" name="href">
<input type="button" value="Go To" onClick="location.href=document.openlocation.href.value + /statistics/;">
</form>
However they need to put the http:// so it knows it's an external address otherwise it will try to load it on your site.

E.g.

http://www.yoursite.com/theresite.com/statistics/

So, insert the http:// for them...

Code: Select all
<form name="openlocation">
<input type="text" name="http" >
<input type="button" value="Go To" onClick="location.href='http://' + document.openlocation.http.value + /statistics/;">
</form>
If they just use www. or no www. it's fine, however if they include the http:// then you'll get issues, so it should be stripped prior to proceeding to the location, unfortunatly my javascript knowlege isn't that good.

But i'll look into it

And as for checking to see if the domain is entered incorrectly, can you elaborate on this a bit?

Because i can already interperate it in a few different ways =/

Last edited by Bocaj; Apr 11th, 2008 at 21:40. Reason: Removed the uneccisary value=""
Bocaj is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 12th, 2008, 08:23   #8 (permalink)
Junior Member
 
Join Date: Aug 2007
Location: London
Posts: 13
Re: submit part of a url through a text box

Hi Bocaj,
Thank you for your hardwork! Your version solved the hiding the http:// part which is great! The error message was for if they accidently entered the wrong domain. But I dont think I can get round this. I will just put a message by the box to let users know to accuately put in their domain name.

Im really pleased with that script now. Does that script use javascript? And if so, and someone has javascript disabled, will the script not work?
Thanks again for your hard work mod and Bocaj.
Mark
markusdavid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 12th, 2008, 08:25   #9 (permalink)
Junior Member
 
Join Date: Aug 2007
Location: London
Posts: 13
Re: submit part of a url through a text box

Oh one other thing :o) You have to physically click on the 'go to' button to go to thye stats page. Is there a way to just press return and it will submit the address?
markusdavid is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
box, form, html, link, password, php, text, url

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
submit many forms - auto submit the same form many times divs JavaScript Forum 0 May 24th, 2007 10:10
SEO / SEM glossary Part 3 webulletin Search Engine Optimization (SEO) 2 Nov 22nd, 2006 23:33
SEO / SEM glossary Part 2 webulletin Search Engine Optimization (SEO) 0 Nov 2nd, 2006 07:59
SEO / SEM glossary Part 1 webulletin Search Engine Optimization (SEO) 1 Oct 19th, 2006 04:36



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 10:48.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59