Wednesday 15 January 2014

php - combine option field results to text field -


I tried to find it and this is probably a simple solution, but I can not understand how an option field To combine the text field in HTML / php / js In fact, the user needs to choose whether he is http or https and then type in the domain. It should be presented as a single variable via _GET.

  & lt; Select & gt; & Lt; Option value = "http: //" & gt; Http: // & lt; / Options & gt; & Lt; Option value = "https: //" & gt; Https: // & lt; / Options & gt; & Lt; / Select & gt; & Lt; Input class = "span4" id = "domain" name = "domain" type = "text" & gt; & Lt; Button class = "btn btn-success" type = "submit" & gt; Submit & lt; / Button & gt; & Lt; / Form & gt;   

Any input will be appreciated.

I'll combine them after submitting ...

HTML page ( You need your SELECT name):

  & lt; Select name = "type" & gt; & Lt; Option value = "http: //" & gt; Http: // & lt; / Options & gt; & Lt; Option value = "https: //" & gt; Https: // & lt; / Options & gt; & Lt; / Select & gt; & Lt; Input class = "span4" id = "domain" name = "domain" type = "text" & gt; & Lt; Button class = "btn btn-success" type = "submit" & gt; Submit & lt; / Button & gt; & Lt; / Form & gt;   

PHP page:

  $ type = $ _GET ['type']; $ Name = $ _GET ['domain']; $ Composite = $ type $ name;             P> 

Of course. As $ name like $ type and www.example.com then the variable Must be a value of $ United for https://www.example.com

No comments:

Post a Comment