开发者

How to add data to a specific form element when it sends to mySQL

开发者 https://www.devze.com 2023-03-21 02:40 出处:网络
I\'m creating a form where people can enter a code, for example H23J3PW, which corresponds to the end of a URL (say for example\'s sake youtube.com/watch?=H23J3PW)

I'm creating a form where people can enter a code, for example H23J3PW, which corresponds to the end of a URL (say for example's sake youtube.com/watch?=H23J3PW)

When the database is submitted to the database I'd 开发者_Python百科like it to submit as the full URL ie "youtube.com/watch?=H23J3PW". Is there an easy way to do this?

The form code at the moment is:

<label>youtube.com/</label><input class="inputtext" type="text" name="youtube" value=""/>

Thanks in advance, I have searched around but haven't been able to find a solution.


$url = "youtube.com/watch?=".$_POST["youtube"];

Then just use $url in your query. As mentioned in the comment, $_POST could be $_GET if your form is submitted using a GET.

0

精彩评论

暂无评论...
验证码 换一张
取 消