Jump to content

[SOLVED] varable not echoing anything at all


jigsawsoul

Recommended Posts

does any one have a clue to why $tablerows is not echoing out, as the page is not displaying the form at all ? any help thanks

 

<?php

session_start();

include '../library/opendb.php';

// Are you loged in an user, when trying to asscess this page.
if ($_SESSION['user_logged_in'] == true) {
// The user is logged in display

$username = $_SESSION["username"];

$result = "SELECT * FROM wbl_login
				LEFT JOIN gb_customers ON gb_login.customer_id=gb_customers.customer_id
				WHERE username = '$username'";

$result = mysql_query ($result) or die (mysql_error());
$row = mysql_fetch_assoc($result);

$username = $row['username'];
$username2 = ucwords($username);
$_SESSION["customerid"] = $row['customer_id'];

$loginbar = '
<div id="logedin" class="clearfix">
    <span class="left clearfix">
    	<h1 id="project_title">User, Gig Bookers</h1>
    </span>
    <span class="right clearfix">
    	'.$username2.'
    	| <a href="account.php">Account</a>
    	| <a href="../login/logout.php">Logout</a>
    </span>
</div>
';

$loginid = $_GET['id'];

$tablerows .= '
	<form action="commissionrequest2.php?id='.$row['commission_id'].'" method="post">
	<table>
    			<tr>
    				<td width="100"><b>Product(s) description:</b></td>
    				<td><textarea input id="description" name="description" size="40" type="text" rows="25" /></textarea><br /></td>
    			</tr>
    			<tr>
    				<td><b>Other comments:</b></td>
    				<td><textarea input id="comments" name="comments" size="40" type="text" rows="25" /></textarea><br /></td>
    			</tr>
    				<td><b>Customer:</b></td>
    				<td><input id="customer" name="customer" size="30" type="text" value='.$row['title'].' '.$row['firstname'].' '.$row['surname'].' /></td>
    			</tr>
    			</tr>
    				<td><b>Telephone:</b></td>
    				<td><input id="telephone" name="telephone" size="30" type="text" value='.$row['telephone'].' /></td>
    			</tr>
    			</tr>
    				<td><b>Email:</b></td>
    				<td><input id="email" name="email" size="30" type="text" value='.$row['email'].' /></td>
    			</tr>
    	</table>
	<br />
    	<input type="submit" value="Save Changes" class="primary" /> <a href="account.php">Go Back</a>
    	</form>
    		
    ';
}


?>

<?php include ('../library/template/public/htmlstart.php'); ?>

<?php echo $loginbar ?>

<div id="header"><img src="images/top.jpg" alt="Gig Bookers" /></div>

<div id="menu" class="clearfix">
	<ul>
		<li ><a href="index.php">Home</a></li>
		<li ><a href="events.php">Commission Request</a></li>
		<li ><a href="tandc.php">Terms And Condition</a></li>
		<li><a href="contact.php">Contact</a></li>
		<li class="login"><a href="../login/login.php">Login / Signup</a></li>
	</ul>
</div>

<div id="wrap" class="clearfix">

	<div id="content" class="clearfix">

		<div class="column_full">
		<h1>Commission Request</h1>

		<?=$tablerows?>

    		<p></p>

	 	</div>
	</div>
</div>
<?php include ('../library/template/public/footer.php'); ?>
</div>

</body>
</html>

Do what smerny said. If that doesn't work, try adding $tablerows = ''; before concatenating $tablerows. I may be wrong but maybe there's an error trying to concatenate with null (shouldn't be a problem).

 

Also, is this condition

if ($_SESSION['user_logged_in'] == true) {

being entered?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.