Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Link Strange behaviour

Status
Not open for further replies.

Pesho318i

Programmer
Jun 16, 2006
13
NL
Hi all,

I've got a strange problem here.
On my web site I have a link which leads to register.php.
It works fine on the machine where I test it. However, when I move to another machine, it leads to a completely blank page... !?!?!

Could it be due to some subtle differences in the Apache version. The working one has Apache 2.0 and the other - Apache2.2 ?

The .php code is not complex at all.
I'm running PHP 5 and mysql 4.1.

thank you,
Pesho
 
Are you using short tags? If they are not allowed by php.ini then you may get this problem. For example if you use <? instead of <?php. I would suspect php rather than apache in this case.

 
hi,

>>mbrooks wrote:
>>Is the DNS resolving the same on both machines?

I guess so. I'm testing the site locally and on the first machine it works with both "localhost" and 127.0.0.1. On the other it works with neither of them :(

>>RhythmAce wrote:
>>Are you using short tags?

nope, I'm using <?php ... ?>

thanks anyway,
...still hoping for a solution,
Pesho
 
here is my h_register.php:
the strange thing is that when I display it directly in a browser it doesn't include the header.php and navigationbar.php and it also prints some fragments of the code e.g.:

$feedback

"; $feedback_str = $feedback; } else { // Show form for the first time $feedback_str = ''; } // ---------------- // DISPLAY THE FORM // ---------------- include("header.php"); include("navigationbar.php"); // Superglobals don't work with heredoc //$php_self = $_SERVER['PHP_SELF']; $php_self = h_register.php; $reg_str = <<< EOREGSTR


I guess RhythmAce was right about the tags, maybe it doesn't recognize the PHP tags, but I think I've typed them correctly.

<?php /* ====================================================

NAME
h_register.php


==========================================================*/ ?>

<?php

require_once('h_register_funcs.inc');

$first_name="";
$last_name="";
$address="";
$city="";
$phone="";
$password="";
$email="";

if (array_key_exists('submit',$_POST) && $_POST['submit'] == 'Mail confirmation') {
$feedback = user_register();

// In every case, successful or not, there will be feedback
$feedback_str = "<P class=\"errormess\">$feedback</P>";
} else {
// Show form for the first time
$feedback_str = '';
}


// ----------------
// DISPLAY THE FORM
// ----------------
include("header.php");
include("navigationbar.php");

// Superglobals don't work with heredoc
$php_self = $_SERVER['PHP_SELF'];

$reg_str = <<< EOREGSTR
<td align="center" valign="top">
<table width="550" height="77" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="75" align="left" valign="bottom"><img src="Welcome.JPG" width="550" height="75"></td>
</tr>
</table>
<br>

<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 ALIGN=CENTER WIDTH=621>
<TR>
<TD width="10%"/>
<TD align="left" valign="top">

$feedback_str
<P CLASS="left"><B>REGISTER</B><BR>
Fill out this form and a confirmation email will be sent to you. Once you click on the link in the email your account will be confirmed and you can begin to contribute to the community.</P>
<FORM ACTION="$php_self" METHOD="POST">
<P CLASS="bold"><B>First Name*</B><BR>
<INPUT TYPE="TEXT" NAME="first_name" VALUE="$first_name" SIZE="20" MAXLENGTH="25"></P>
<P CLASS="bold"><B>Last Name*</B><BR>
<INPUT TYPE="TEXT" NAME="last_name" VALUE="$last_name" SIZE="20" MAXLENGTH="25"></P>
<P CLASS="bold"><B>Address</B><BR>
<INPUT TYPE="TEXT" NAME="address" VALUE="$address" SIZE="10" MAXLENGTH="25"></P>
<P CLASS="bold"><B>City</B><BR>
<INPUT TYPE="TEXT" NAME="city" VALUE="$city" SIZE="10" MAXLENGTH="25"></P>
<P CLASS="bold"><B>Phone*</B><BR>
<INPUT TYPE="TEXT" NAME="phone" VALUE="$phone" SIZE="10" MAXLENGTH="25"></P>
<P CLASS="bold"><B>Password*</B><BR>
<INPUT TYPE="password" NAME="password1" VALUE="" SIZE="10" MAXLENGTH="25"></P>
<P CLASS="left"><B>Password*</B> (again)<BR>
<INPUT TYPE="password" NAME="password2" VALUE="" SIZE="10" MAXLENGTH="25"></P>
<P CLASS="left"><B>Email*</B> (required for confirmation)<BR>
<INPUT TYPE="TEXT" NAME="email" VALUE="$email" SIZE="30" MAXLENGTH="50"></P>
<P><INPUT TYPE="SUBMIT" NAME="submit" VALUE="Mail confirmation"></P>
</FORM>
</TD>
<TD width="10%"/>
</TR>
</TABLE>
</TD>
EOREGSTR;
echo $reg_str;

include("bottom.php");

?>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top