Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 11th, 2012  |  syntax: None  |  size: 2.67 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Include statment have different behavior when called from a function?
  2. require_once("registration/include/membersite_config.php");
  3.        
  4. $result=mysql_query("SELECT id FROM ".table_links." WHERE url = '".$fgmembersite->SanitizeForSQL($_POST['j_title'])."';");
  5. if (mysql_num_rows($result)>0) {
  6. the_error('The url '. siteurl .'/'. $_POST['j_title'].' is currently in use, please use another one.');
  7. }
  8.        
  9. $fgmembersite->DBLogin();
  10. 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."');");
  11. echo '<!DOCTYPE html>
  12. <html lang="en">
  13. <head>';
  14. include("parts/head.php");
  15. echo '</head>
  16. <body>
  17. <div id="footerfix">';
  18. include("parts/header.php");
  19. echo '<div class="container">
  20.       <center><br><br><br><img src="css/img/ok.png"/></center>
  21.       <div class="hero-unit">
  22.         <center>
  23.         <h2>Your track URL <a href="'. siteurl . '/' . $_POST['j_title'].'">'.siteurl . '/' . $_POST['j_title'].'</a> have been created.</h2>';
  24.         if ($secutype==0){echo '<p>This url is public. Click <a href="profile.php">here</a> to return to your dashboard.</p>';}
  25.         if ($secutype==1){echo '<p>This is a password protected url. Click <a href="profile.php">here</a> to return to your dashboard.</p>';}
  26.         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>
  27.         <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>';}
  28.         echo '</center>
  29.       </div>
  30.     </div>';
  31.     include("parts/footer.php");
  32.     echo '
  33.     </div>
  34.   </body>
  35. </html>';
  36. }
  37.        
  38. function the_error($error) {
  39.     echo '<!DOCTYPE html>
  40.           <html lang="en">
  41.           <head>';
  42.     include("parts/head.php");
  43.     echo '</head>
  44.           <body>
  45.           <div id="footerfix">';
  46.     include("parts/header.php");
  47.     echo '<div class="container"><center><br><br><br><img src="css/img/notok.png"/></center><div class="hero-unit"><center><h2>Error</h2>';
  48.     echo '<p>'.$error.'</p>';
  49.     echo '</center></div></div>';
  50.     include("parts/footer.php");
  51.     echo '</div></body></html>';
  52.     exit;
  53. }
  54.        
  55. global $fgmembersite;