jigsawsoul Posted August 10, 2009 Share Posted August 10, 2009 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> Quote Link to comment https://forums.phpfreaks.com/topic/169617-solved-varable-not-echoing-anything-at-all/ Share on other sites More sharing options...
smerny Posted August 10, 2009 Share Posted August 10, 2009 <?=$tablerows?> change that to <?php echo $tablerows; ?> Quote Link to comment https://forums.phpfreaks.com/topic/169617-solved-varable-not-echoing-anything-at-all/#findComment-894858 Share on other sites More sharing options...
alexdemers Posted August 10, 2009 Share Posted August 10, 2009 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? Quote Link to comment https://forums.phpfreaks.com/topic/169617-solved-varable-not-echoing-anything-at-all/#findComment-894867 Share on other sites More sharing options...
jarvis Posted August 10, 2009 Share Posted August 10, 2009 As smerny says - <?php echo $tablerows; ?> Just tried it with your code and that worked fine Quote Link to comment https://forums.phpfreaks.com/topic/169617-solved-varable-not-echoing-anything-at-all/#findComment-894871 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.