Jump to content

[SOLVED] Is java script right?


dare87

Recommended Posts

I want to place a text box on a webpage so that you can place information in the box and then when you hit submit it will forward you to

www.domainl.com/TEXTBOXINFO

 

Is Javascript the best way to do that.

 

Also I want to "hide" the url so that it doesn't look like the path has changed. I think that would be done in htaccess. I've been looking online and I can only find a iframe solution and I don't want that.

 

Thanks for the help

Link to comment
https://forums.phpfreaks.com/topic/179149-solved-is-java-script-right/
Share on other sites

You can't hide the URL that way. Each URL still has to be unique even if you re-write them, and since you are already on one page and want to go to another one, you will need to also change the URL.

 

A possible way around this is to use AJAX to load the page you want to go to inside the page you are in.

 

As for what you are asking, javascript is the only way you can do it.

I wouldn't say it is the ONLY way to do it, but Javascript is the easiest and fastest option.

 

I have not heard of using .htaccess to hide the URL of the current page. The only way I can think of is by using frames, or as haku suggested, AJAX.

 

However, there is a better solution if you are able to use some server-side scripts: submit the text box in a form to the same page using method="post". Using your server-side script, access the file TEXTBOXINFO and print it out on the same page! There you have it, no visible change in the URL and content from the specified file!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.