top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to pass parameter via URL in PHP

0 votes

I would like to know how can I pass a parameter via URL using control value on the form.
Something like myPage.php?MyID=txtMyID.value
I can use myPage.php?MyID=1, but cannot use myPage.php?MyID=txtMyID.value.

posted May 20, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

This is more a js question. Because form.controlname.value is only available in javascript. A similar question answered long ago on Stackoverflow is

And here is function that does it using pure javascript.

answer May 20, 2013 by anonymous
Thanks for the message and helping, Your js looks like to parse URL.Please let me know if I am wrong, Do you have any code to generate the URL parameter using control value?
You can generate the url using string concatenation operator +.
To keep it consistent and out of error you need to reverse the same function i have given then you can perform both. The idea is there.
Similar Questions
+2 votes

I want to build a A URL Shortener service in my PHP based Website without use of any thirdparty tool. Any clue or opensource would be a great help?

+2 votes

Hi,I have a url some thing like this need to replace end of slash in the url.

I need url like this

+1 vote

I'm adding some minification to our cache.class.php and am running into an edge case that is causing me grief.

I want to remove all comments of the // variety, HOWEVER I don't want to remove URLs...

Given some example text here with carefully crafted cases:

// another comment here

function bookmarksite(title,url){
 if (window.sidebar) // firefox
 window.sidebar.addPanel(title, url, "");
 else if(window.opera &
 else if(document.all)// ie
 window.external.AddFavorite(url, title);

I've tried so many variations and hunted on StackOverflow, Google, etc. and what would seem like a task already solved, doesn't seem to be.

This is "close", but still matches // (omitting the : of course)

s*(?!:)//.*?$ (count it as '/m' multiline)

This ultimately ends up in a PHP line of code like so:

$sBlob = preg_replace("@s*//.*?$@m",'',$sBlob);

Here are some other links of stuff I've found and tried to experiment with varying degrees.