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>

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.