iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > HTML, XHTML and CSS

Reply
 
LinkBack Thread Tools
Old April 10th, 2008, 07:38 PM   #1
New Member
 

Join Date: Aug 2007
Location: London
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 markusdavid is on a distinguished road
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 April 10th, 2008, 08:05 PM   #2
Highly Reputable Member
 

Join Date: Mar 2008
Location: Chester, UK
Age: 18
Posts: 563
Thanks: 2
Thanked 41 Times in 41 Posts
Rep Altering Power: 0 Bocaj is on a distinguished road
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; April 10th, 2008 at 08:37 PM.. 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 April 11th, 2008, 03:23 AM   #3
New Member
 

Join Date: Aug 2007
Location: London
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 markusdavid is on a distinguished road
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 April 11th, 2008, 11:32 AM   #4
New Member
 

Join Date: Aug 2007
Location: London
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 markusdavid is on a distinguished road
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 April 11th, 2008, 12:35 PM   #5
Aso
Most Reputable Member
 

Join Date: Oct 2007
Location: UK
Posts: 1,633
Blog Entries: 2
Thanks: 22
Thanked 84 Times in 79 Posts
Rep Altering Power: 0 Aso is on a distinguished road
Re: submit part of a url through a text box

Code:
<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>
Aso 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 April 11th, 2008, 02:15 PM   #6
New Member
 

Join Date: Aug 2007
Location: London
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 markusdavid is on a distinguished road
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 April 11th, 2008, 05:35 PM   #7
Highly Reputable Member
 

Join Date: Mar 2008
Location: Chester, UK
Age: 18
Posts: 563
Thanks: 2
Thanked 41 Times in 41 Posts
Rep Altering Power: 0 Bocaj is on a distinguished road
Re: submit part of a url through a text box

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

Code:
<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:
<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; April 11th, 2008 at 05:40 PM.. 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 April 12th, 2008, 04:23 AM   #8
New Member
 

Join Date: Aug 2007
Location: London
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 markusdavid is on a distinguished road
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 April 12th, 2008, 04:25 AM   #9
New Member
 

Join Date: Aug 2007
Location: London
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 markusdavid is on a distinguished road
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

Bookmarks

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


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

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 0 May 24th, 2007 06:10 AM
SEO / SEM glossary Part 3 webulletin Search Engine Optimization (SEO) 2 November 22nd, 2006 07:33 PM
SEO / SEM glossary Part 2 webulletin Search Engine Optimization (SEO) 0 November 2nd, 2006 03:59 AM
SEO / SEM glossary Part 1 webulletin Search Engine Optimization (SEO) 1 October 19th, 2006 12:36 AM


Search Engine Optimization by vBSEO 3.2.0 RC8