开发者

Php splash page generator

I am trying to create a splash page generator and I have a small problem.

$accountid = $_POST['accountid'];

(I also tried with $_GET and $_REQUEST and the form page is done and the name is correct)

$reflink = "< a href="http://www.site.com/?ref=$accountid">today< / a>";

echo "Join " . $reflink . "line breaks here;

The problem is that the slashes // are used for comments too and the link is not working, when removing the http:// it searches in the server files like site.com/files/site.com/?r=

I also tried with www., not working.

Any help is appreciated.

开发者_运维问答

I have put some spaces inside the code, otherwise it wouldn't show properly.


As far as I can understand your question, you need to escape the quotes:

$reflink = "< a href=\"http://www.site.com/?ref=$accountid\">today< / a>";

or:

$reflink = "< a href='http://www.site.com/?ref=$accountid'>today< / a>";

And if $accountid is an integer, I would also use:

$accountid = (int) $_POST['accountid'];

(I would clean it up anyway, but it seems it´s an integer...)


You need to escape your quote marks:

$reflink = "< a href=\"http://www.site.com/?ref=$accountid\">today< / a>";
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜