PHP with Apache

  • ilyawizard
  • Proficient
  • Proficient
  • ilyawizard
  • Posts: 413

Post 3+ Months Ago

I just bought myself a domain name and tried a few things. This is a website:
http://www.njrussians.com
I run apache2 with PHP4 and MySQL. Everything works perfect under WinXP server, but on Linux somthing different. When u click on register u get a blank page, but supposed to be a register page. I think there is problem with PHP but not quite sure where. Any ideas?

EDIT: Yeah, and under localhost it doesn't work too (works on localhost on WinXP only)
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • ilyawizard
  • Proficient
  • Proficient
  • ilyawizard
  • Posts: 413

Post 3+ Months Ago

Here's code of my register.php. It works in winXP environment, but not in Linux:

PHP Code: [ Select ]
<html>
 
<head>
 
<title>Welcome to Rider International Club WebSite</title>
 
<style tyle=text/css>
 
input.yellow {background-color: #FFFF99; width:100px; height:20px; border-color: 001270; font-weight: bold; font-size: 12px; color: 001270;}
 
textarea {background-color: #FFFF99; width:100px; border-color: 001270; font-weight: bold; font-size: 12px; color: 001270;}
 
</style>
 
</head>
 
<body background=bg.gif link=#6A0000 vlink=#6A0000>
 
 
 
<table border=1 height=<?php echo $x=600 ?> bgcolor=yellow bordercolor=red cellpadding=0 cellspacing=0><tr><td>
 
<table height=<?php echo $x-10 ?> width=840 bgcolor=#ffff44 border=0 cellpadding=0 cellspacing=0>
 
<tr>
 
<td height=100><img src="logo2.jpg"></td>
 
<td height=100>
 
   <table width=315 border=1 bordercolor=red cellpadding=0 cellspacing=0>
 
   <tr height=25><td align=center><font size=3 color=#001270><b>Register please!</b></font></td></tr>
 
   <tr height=60 bgcolor=#ffff99><td>
 
   <a href=index.php><img src=home.gif border=0></a>
 
   <a href=news.php><img src=news.gif border=0></a>
 
   <a href=photo.php><img src=photo.gif border=0></a>
 
   <a href=history.php><img src=history.gif border=0></a>
 
   <a href=misc.php><img src=misc.gif border=0></a>
 
   </td></tr>
 
   </table>
 
</td>
 
<td rowspan=2>
 
   <table border=0>
 
   <tr height=0><td>
 
   </td></tr>
 
   <tr><td>
 
      <table bgcolor=#ffff99 width=100 height=<?php echo $x-42 ?> border=1 bordercolor=red cellpadding=0 cellspacing=0>
 
      <tr><td>
 
      advertisement
 
      </td></tr>
 
      </table>
 
   </td></tr>
 
   </table>
 
</td>
 
</tr>
 
 
 
<tr>
 
<td colspan=2 height=<?php echo $x-140 ?>>
 
   <table align=center border=1 bordercolor=red background=bg1.gif align=center height=<?php echo $x-140 ?> width=730 cellpadding=0 cellspacing=0>
 
   <tr><td>
 
   <?php
 
   include ("connect.php");
 
   @mysql_select_db('users', $conn);
 
   if ($_POST['x']=="reg") {
 
      $u=$_POST['username'];
 
      $p=$_POST['password'];
 
      $e=$_POST['email'];
 
      $f=$_POST['firstname'];
 
      $l=$_POST['lastname'];
 
      $i=$_POST['info'];
 
      if (!$u || !$p || !$e || !$f || !$l || !$i) {
 
         echo "<center><font size=2 color=#001270><b>You did not specified the folowing information: <br>";
 
         if (!$u) {
 
            echo "Username ";
 
         }
 
         if (!$p) {
 
            echo "Password ";
 
         }
 
         if (!$e) {
 
            echo "E-mail ";
 
         }
 
         if (!$f) {
 
            echo "First Name ";
 
         }
 
         if (!$l) {
 
            echo "Last Name ";
 
         }
 
         if (!$i) {
 
            echo "Information</b></font><br>";
 
         }
 
         echo "</center>";
 
         include ("regform.php");
 
      }
 
      else {
 
         $chkuser=@mysql_query("SELECT username FROM users WHERE username='$u'");
 
         $chkemail=@mysql_query("SELECT email FROM users WHERE email='$e'");
 
         if ((mysql_num_rows($chkuser))>0) {
 
            echo "<font size=2 color=#001270><b><center>Username with this username already exist. </center></b></font>";
 
            include ("regform.php");
 
         }
 
         elseif ((mysql_num_rows($chkemail))>0) {
 
            echo "<font size=2 color=#001270><b><center>Username with this e-mail already exist. </center></b></font>";
 
            include ("regform.php");
 
         }
 
         else {
 
            $q="INSERT INTO users SET
 
            username='$u', password='$p', email='$e', first_name='$f', last_name='$l', info='$i', signup_date=now()";
 
            if (!@mysql_query($q)) {
 
               die ("Failure during adding new user. Try again.");
 
               include ("regform.php");
 
            }
 
            else {
 
               $id=@mysql_fetch_array(@mysql_query("SELECT userid FROM users WHERE email=$e"));
 
               $topic="RiderIC Registration";
 
               $message="Welcome to RiderIC!
 
               You have been registered in our website. Please click the following link for activation of your account:
 
               <!-- m --><span class="postlink">http://localhost/ic/activate.php?id=$id</span><!-- m -->['userid']&p=$p
 
               Thanks for registering, RiderIC";
 
               mail($e, $topic, $message);
 
            }
 
         }
 
      }  
 
   }
 
   else {
 
      include ("regform.php");
 
   }
 
   ?>
 
   </td></tr>
 
   </table>
 
</td>
 
</tr>
 
<tr><td colspan=3>
 
   <table bgcolor=#ffff99 align=center width=836 height=10 border=1 bordercolor=red cellpadding=0 cellspacing=0>
 
   <tr><td>
 
   <font size=2 color=#3A0000><center>
 
   <a href=about.php>About RiderIC</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
   <a href=agreement.php>Service Agreement</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
   <a href=ad.php>Advertisement</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
   <a href=contact.php>Contact Us</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
   <a href=feedback.php>Leave Feedback</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
   &copy;2004 RiderIC
 
   </center></font>
 
   </td></tr>
 
   </table>
 
</td></tr>
 
</table>
 
</td></tr></table>
 
 
 
 
 
 
 
</body>
 
</html>
  1. <html>
  2.  
  3. <head>
  4.  
  5. <title>Welcome to Rider International Club WebSite</title>
  6.  
  7. <style tyle=text/css>
  8.  
  9. input.yellow {background-color: #FFFF99; width:100px; height:20px; border-color: 001270; font-weight: bold; font-size: 12px; color: 001270;}
  10.  
  11. textarea {background-color: #FFFF99; width:100px; border-color: 001270; font-weight: bold; font-size: 12px; color: 001270;}
  12.  
  13. </style>
  14.  
  15. </head>
  16.  
  17. <body background=bg.gif link=#6A0000 vlink=#6A0000>
  18.  
  19.  
  20.  
  21. <table border=1 height=<?php echo $x=600 ?> bgcolor=yellow bordercolor=red cellpadding=0 cellspacing=0><tr><td>
  22.  
  23. <table height=<?php echo $x-10 ?> width=840 bgcolor=#ffff44 border=0 cellpadding=0 cellspacing=0>
  24.  
  25. <tr>
  26.  
  27. <td height=100><img src="logo2.jpg"></td>
  28.  
  29. <td height=100>
  30.  
  31.    <table width=315 border=1 bordercolor=red cellpadding=0 cellspacing=0>
  32.  
  33.    <tr height=25><td align=center><font size=3 color=#001270><b>Register please!</b></font></td></tr>
  34.  
  35.    <tr height=60 bgcolor=#ffff99><td>
  36.  
  37.    <a href=index.php><img src=home.gif border=0></a>
  38.  
  39.    <a href=news.php><img src=news.gif border=0></a>
  40.  
  41.    <a href=photo.php><img src=photo.gif border=0></a>
  42.  
  43.    <a href=history.php><img src=history.gif border=0></a>
  44.  
  45.    <a href=misc.php><img src=misc.gif border=0></a>
  46.  
  47.    </td></tr>
  48.  
  49.    </table>
  50.  
  51. </td>
  52.  
  53. <td rowspan=2>
  54.  
  55.    <table border=0>
  56.  
  57.    <tr height=0><td>
  58.  
  59.    </td></tr>
  60.  
  61.    <tr><td>
  62.  
  63.       <table bgcolor=#ffff99 width=100 height=<?php echo $x-42 ?> border=1 bordercolor=red cellpadding=0 cellspacing=0>
  64.  
  65.       <tr><td>
  66.  
  67.       advertisement
  68.  
  69.       </td></tr>
  70.  
  71.       </table>
  72.  
  73.    </td></tr>
  74.  
  75.    </table>
  76.  
  77. </td>
  78.  
  79. </tr>
  80.  
  81.  
  82.  
  83. <tr>
  84.  
  85. <td colspan=2 height=<?php echo $x-140 ?>>
  86.  
  87.    <table align=center border=1 bordercolor=red background=bg1.gif align=center height=<?php echo $x-140 ?> width=730 cellpadding=0 cellspacing=0>
  88.  
  89.    <tr><td>
  90.  
  91.    <?php
  92.  
  93.    include ("connect.php");
  94.  
  95.    @mysql_select_db('users', $conn);
  96.  
  97.    if ($_POST['x']=="reg") {
  98.  
  99.       $u=$_POST['username'];
  100.  
  101.       $p=$_POST['password'];
  102.  
  103.       $e=$_POST['email'];
  104.  
  105.       $f=$_POST['firstname'];
  106.  
  107.       $l=$_POST['lastname'];
  108.  
  109.       $i=$_POST['info'];
  110.  
  111.       if (!$u || !$p || !$e || !$f || !$l || !$i) {
  112.  
  113.          echo "<center><font size=2 color=#001270><b>You did not specified the folowing information: <br>";
  114.  
  115.          if (!$u) {
  116.  
  117.             echo "Username ";
  118.  
  119.          }
  120.  
  121.          if (!$p) {
  122.  
  123.             echo "Password ";
  124.  
  125.          }
  126.  
  127.          if (!$e) {
  128.  
  129.             echo "E-mail ";
  130.  
  131.          }
  132.  
  133.          if (!$f) {
  134.  
  135.             echo "First Name ";
  136.  
  137.          }
  138.  
  139.          if (!$l) {
  140.  
  141.             echo "Last Name ";
  142.  
  143.          }
  144.  
  145.          if (!$i) {
  146.  
  147.             echo "Information</b></font><br>";
  148.  
  149.          }
  150.  
  151.          echo "</center>";
  152.  
  153.          include ("regform.php");
  154.  
  155.       }
  156.  
  157.       else {
  158.  
  159.          $chkuser=@mysql_query("SELECT username FROM users WHERE username='$u'");
  160.  
  161.          $chkemail=@mysql_query("SELECT email FROM users WHERE email='$e'");
  162.  
  163.          if ((mysql_num_rows($chkuser))>0) {
  164.  
  165.             echo "<font size=2 color=#001270><b><center>Username with this username already exist. </center></b></font>";
  166.  
  167.             include ("regform.php");
  168.  
  169.          }
  170.  
  171.          elseif ((mysql_num_rows($chkemail))>0) {
  172.  
  173.             echo "<font size=2 color=#001270><b><center>Username with this e-mail already exist. </center></b></font>";
  174.  
  175.             include ("regform.php");
  176.  
  177.          }
  178.  
  179.          else {
  180.  
  181.             $q="INSERT INTO users SET
  182.  
  183.             username='$u', password='$p', email='$e', first_name='$f', last_name='$l', info='$i', signup_date=now()";
  184.  
  185.             if (!@mysql_query($q)) {
  186.  
  187.                die ("Failure during adding new user. Try again.");
  188.  
  189.                include ("regform.php");
  190.  
  191.             }
  192.  
  193.             else {
  194.  
  195.                $id=@mysql_fetch_array(@mysql_query("SELECT userid FROM users WHERE email=$e"));
  196.  
  197.                $topic="RiderIC Registration";
  198.  
  199.                $message="Welcome to RiderIC!
  200.  
  201.                You have been registered in our website. Please click the following link for activation of your account:
  202.  
  203.                <!-- m --><span class="postlink">http://localhost/ic/activate.php?id=$id</span><!-- m -->['userid']&p=$p
  204.  
  205.                Thanks for registering, RiderIC";
  206.  
  207.                mail($e, $topic, $message);
  208.  
  209.             }
  210.  
  211.          }
  212.  
  213.       }  
  214.  
  215.    }
  216.  
  217.    else {
  218.  
  219.       include ("regform.php");
  220.  
  221.    }
  222.  
  223.    ?>
  224.  
  225.    </td></tr>
  226.  
  227.    </table>
  228.  
  229. </td>
  230.  
  231. </tr>
  232.  
  233. <tr><td colspan=3>
  234.  
  235.    <table bgcolor=#ffff99 align=center width=836 height=10 border=1 bordercolor=red cellpadding=0 cellspacing=0>
  236.  
  237.    <tr><td>
  238.  
  239.    <font size=2 color=#3A0000><center>
  240.  
  241.    <a href=about.php>About RiderIC</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  242.  
  243.    <a href=agreement.php>Service Agreement</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  244.  
  245.    <a href=ad.php>Advertisement</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  246.  
  247.    <a href=contact.php>Contact Us</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  248.  
  249.    <a href=feedback.php>Leave Feedback</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  250.  
  251.    &copy;2004 RiderIC
  252.  
  253.    </center></font>
  254.  
  255.    </td></tr>
  256.  
  257.    </table>
  258.  
  259. </td></tr>
  260.  
  261. </table>
  262.  
  263. </td></tr></table>
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271. </body>
  272.  
  273. </html>
[/php]
  • ilyawizard
  • Proficient
  • Proficient
  • ilyawizard
  • Posts: 413

Post 3+ Months Ago

So far I know that problem is in this part of code:
PHP Code: [ Select ]
 
    <?php
 
    include ("connect.php");
 
    @mysql_select_db('users', $conn);
 
    if ($_POST['x']=="reg") {
 
        $u=$_POST['username'];
 
        $p=$_POST['password'];
 
        $e=$_POST['email'];
 
        $f=$_POST['firstname'];
 
        $l=$_POST['lastname'];
 
        $i=$_POST['info'];
 
        if (!$u || !$p || !$e || !$f || !$l || !$i) {
 
            echo "<center><font size=2 color=#001270><b>You did not specified the folowing information: <br>";
 
            if (!$u) {
 
                echo "Username ";
 
            }
 
            if (!$p) {
 
                echo "Password ";
 
            }
 
            if (!$e) {
 
                echo "E-mail ";
 
            }
 
            if (!$f) {
 
                echo "First Name ";
 
            }
 
            if (!$l) {
 
                echo "Last Name ";
 
            }
 
            if (!$i) {
 
                echo "Information</b></font><br>";
 
            }
 
            echo "</center>";
 
            include ("regform.php");
 
        }
 
        else {
 
            $chkuser=@mysql_query("SELECT username FROM users WHERE username='$u'");
 
            $chkemail=@mysql_query("SELECT email FROM users WHERE email='$e'");
 
            if ((mysql_num_rows($chkuser))>0) {
 
                echo "<font size=2 color=#001270><b><center>Username with this username already exist. </center></b></font>";
 
                include ("regform.php");
 
            }
 
            elseif ((mysql_num_rows($chkemail))>0) {
 
                echo "<font size=2 color=#001270><b><center>Username with this e-mail already exist. </center></b></font>";
 
                include ("regform.php");
 
            }
 
            else {
 
                $q="INSERT INTO users SET
 
               username='$u', password='$p', email='$e', first_name='$f', last_name='$l', info='$i', signup_date=now()";
 
                if (!@mysql_query($q)) {
 
                    die ("Failure during adding new user. Try again.");
 
                    include ("regform.php");
 
                }
 
                else {
 
                    $id=@mysql_fetch_array(@mysql_query("SELECT userid FROM users WHERE email=$e"));
 
                    $topic="RiderIC Registration";
 
                    $message="Welcome to RiderIC!
 
                   You have been registered in our website. Please click the following link for activation of your account:
 
                   <!-- m --><span class="postlink">http://localhost/ic/activate.php?id=$id</span><!-- m -->['userid']&p=$p
 
                   Thanks for registering, RiderIC";
 
                    mail($e, $topic, $message);
 
                }
 
            }
 
        }    
 
    }
 
    else {
 
        include ("regform.php");
 
    }
 
    ?>
 
 
  1.  
  2.     <?php
  3.  
  4.     include ("connect.php");
  5.  
  6.     @mysql_select_db('users', $conn);
  7.  
  8.     if ($_POST['x']=="reg") {
  9.  
  10.         $u=$_POST['username'];
  11.  
  12.         $p=$_POST['password'];
  13.  
  14.         $e=$_POST['email'];
  15.  
  16.         $f=$_POST['firstname'];
  17.  
  18.         $l=$_POST['lastname'];
  19.  
  20.         $i=$_POST['info'];
  21.  
  22.         if (!$u || !$p || !$e || !$f || !$l || !$i) {
  23.  
  24.             echo "<center><font size=2 color=#001270><b>You did not specified the folowing information: <br>";
  25.  
  26.             if (!$u) {
  27.  
  28.                 echo "Username ";
  29.  
  30.             }
  31.  
  32.             if (!$p) {
  33.  
  34.                 echo "Password ";
  35.  
  36.             }
  37.  
  38.             if (!$e) {
  39.  
  40.                 echo "E-mail ";
  41.  
  42.             }
  43.  
  44.             if (!$f) {
  45.  
  46.                 echo "First Name ";
  47.  
  48.             }
  49.  
  50.             if (!$l) {
  51.  
  52.                 echo "Last Name ";
  53.  
  54.             }
  55.  
  56.             if (!$i) {
  57.  
  58.                 echo "Information</b></font><br>";
  59.  
  60.             }
  61.  
  62.             echo "</center>";
  63.  
  64.             include ("regform.php");
  65.  
  66.         }
  67.  
  68.         else {
  69.  
  70.             $chkuser=@mysql_query("SELECT username FROM users WHERE username='$u'");
  71.  
  72.             $chkemail=@mysql_query("SELECT email FROM users WHERE email='$e'");
  73.  
  74.             if ((mysql_num_rows($chkuser))>0) {
  75.  
  76.                 echo "<font size=2 color=#001270><b><center>Username with this username already exist. </center></b></font>";
  77.  
  78.                 include ("regform.php");
  79.  
  80.             }
  81.  
  82.             elseif ((mysql_num_rows($chkemail))>0) {
  83.  
  84.                 echo "<font size=2 color=#001270><b><center>Username with this e-mail already exist. </center></b></font>";
  85.  
  86.                 include ("regform.php");
  87.  
  88.             }
  89.  
  90.             else {
  91.  
  92.                 $q="INSERT INTO users SET
  93.  
  94.                username='$u', password='$p', email='$e', first_name='$f', last_name='$l', info='$i', signup_date=now()";
  95.  
  96.                 if (!@mysql_query($q)) {
  97.  
  98.                     die ("Failure during adding new user. Try again.");
  99.  
  100.                     include ("regform.php");
  101.  
  102.                 }
  103.  
  104.                 else {
  105.  
  106.                     $id=@mysql_fetch_array(@mysql_query("SELECT userid FROM users WHERE email=$e"));
  107.  
  108.                     $topic="RiderIC Registration";
  109.  
  110.                     $message="Welcome to RiderIC!
  111.  
  112.                    You have been registered in our website. Please click the following link for activation of your account:
  113.  
  114.                    <!-- m --><span class="postlink">http://localhost/ic/activate.php?id=$id</span><!-- m -->['userid']&p=$p
  115.  
  116.                    Thanks for registering, RiderIC";
  117.  
  118.                     mail($e, $topic, $message);
  119.  
  120.                 }
  121.  
  122.             }
  123.  
  124.         }    
  125.  
  126.     }
  127.  
  128.     else {
  129.  
  130.         include ("regform.php");
  131.  
  132.     }
  133.  
  134.     ?>
  135.  
  136.  
  • Maedhros
  • Proficient
  • Proficient
  • User avatar
  • Posts: 325
  • Loc: Durham, England

Post 3+ Months Ago

Hmm.... just because a variable is empty, doesn't necessarily mean it's false. Try using if (empty($u)) { ... } and so on. I don't know what would cause it to not display at all, though. Put echo statements in it at regular intervals, and see where the script gets to.
  • ilyawizard
  • Proficient
  • Proficient
  • ilyawizard
  • Posts: 413

Post 3+ Months Ago

Ok...i found the problem it's in the part where it's sending email... But why it wouldn't work and what should I chenge?
$id=@mysql_fetch_array(@mysql_query("SELECT userid FROM users WHERE email=$e"));
$topic="RiderIC Registration";
$message="Welcome to RiderIC!
You have been registered in our website. Please click the following link for activation of your account:
http://localhost/ic/activate.php?id=$id['userid']&p=$p
Thanks for registering, RiderIC";
mail($e, $topic, $message);

EDIT: Ok, it doesn't want to show the page because of the varibale $message. When I deleted that line it works perfectly. What's wrong with that line???

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 33 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.