Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Add an Error Check to Add.cgi

Quote Reply
Add an Error Check to Add.cgi
Hello everyone!

I have a value="http://" in the URL field on add.cgi so that the user will not just enter blah.com or something. So, what I need is: how do I make an error check to make sure they enter a URL. I know this works, but what is the Links SQL coding?

if ($URL = "http://") {
&site_html_add_error("You need to enter a URL");
}


Thanks for your help!



Daniel
-http://www.christian-search.net
-http://www.csnhost.com
Quote Reply
Re: Add an Error Check to Add.cgi In reply to
If you are using Links SQL v.1.13, then you can simply use the following codes:

Code:

if ($in->param('URL') eq 'http://') {
&site_html_add_failure ({$error => "You need to enter a web site address.", %in}, $dynamic);
exit;
}


Then add the following tag in your add_error.html file:

Code:

<%error%>


BUT you should already have that tag in there anyway.

Regards,

Eliot Lee
Quote Reply
Re: Add an Error Check to Add.cgi In reply to
after that site_html_failure (blah blah blah); line.. add..

return;

Jerry Su
widgetz sucks