- Include statment have different behavior when called from a function?
- require_once("registration/include/membersite_config.php");
- $result=mysql_query("SELECT id FROM ".table_links." WHERE url = '".$fgmembersite->SanitizeForSQL($_POST['j_title'])."';");
- if (mysql_num_rows($result)>0) {
- the_error('The url '. siteurl .'/'. $_POST['j_title'].' is currently in use, please use another one.');
- }
- $fgmembersite->DBLogin();
- mysql_query("INSERT INTO " . table_links . " (id, usr_code, visits, url, datetime, type, description, secu_type, password, phone, address, email, photo, id_number) VALUES (NULL, '".$_SESSION['user_code']."', '0', '".$fgmembersite->SanitizeForSQL($_POST['j_title'])."', NOW(), '0', '".$fgmembersite->SanitizeForSQL($_POST['j_desc'])."', '".$secutype."', '".$mod_pass."', '".$phone_check."', '".$address_check."', '".$email_check."', '".$photo_check."', '".$id_check."');");
- echo '<!DOCTYPE html>
- <html lang="en">
- <head>';
- include("parts/head.php");
- echo '</head>
- <body>
- <div id="footerfix">';
- include("parts/header.php");
- echo '<div class="container">
- <center><br><br><br><img src="css/img/ok.png"/></center>
- <div class="hero-unit">
- <center>
- <h2>Your track URL <a href="'. siteurl . '/' . $_POST['j_title'].'">'.siteurl . '/' . $_POST['j_title'].'</a> have been created.</h2>';
- if ($secutype==0){echo '<p>This url is public. Click <a href="profile.php">here</a> to return to your dashboard.</p>';}
- if ($secutype==1){echo '<p>This is a password protected url. Click <a href="profile.php">here</a> to return to your dashboard.</p>';}
- if ($secutype==2){echo '<p style="font-size:16px">The visitors of this URL will need an special QR code. We offer you two options:</p>
- <p>1. Download the <a href="http://chart.googleapis.com/chart?chs=70x70&cht=qr&chf=bg,s,FFFFFF00&chl='.$mod_pass.'">QR code image</a> and add it to your personal design <br>2. Or Download a ready to print business card model</p><br><p>Click <a href="profile.php">here</a> to return to your dashboard.</p>';}
- echo '</center>
- </div>
- </div>';
- include("parts/footer.php");
- echo '
- </div>
- </body>
- </html>';
- }
- function the_error($error) {
- echo '<!DOCTYPE html>
- <html lang="en">
- <head>';
- include("parts/head.php");
- echo '</head>
- <body>
- <div id="footerfix">';
- include("parts/header.php");
- echo '<div class="container"><center><br><br><br><img src="css/img/notok.png"/></center><div class="hero-unit"><center><h2>Error</h2>';
- echo '<p>'.$error.'</p>';
- echo '</center></div></div>';
- include("parts/footer.php");
- echo '</div></body></html>';
- exit;
- }
- global $fgmembersite;