The PHP shows on the page and the forms don't work.

I am making a website for a business and they have requested a registration system, to do this I have used JPMaster77s’ login system with admin features from http://www.evolt.org/node/60384, I had installed the script and it worked, but now when I am testing it the PHP shows up and the form doesn’t work.

Please could somebody help me work out this problem.

Download: http://www.mediafire.com/?8al052o1ou762nq

Screenshots:

Theres a lot of stuff to go through in the download :confused:
Have you made sure all the php is within <?php ?>
Check to make sure you don’t have any
commas ’
or
speech marks "
miss placed or anything.

If you have an editor which displays the different colours its easier to see.
Are you able to post the code your trying to work on?

I am using Notepad++ because it shows the colours, I am still looking through it, but this only seems to affect the Login and Register pages.

This is the main section of code, if we can get this page working the fix should apply to the registration page too.
[php]<?
/**

  • index.php
  • This is an example of the main page of a website. Here
  • users will be able to login. However, like on most sites
  • the login form doesn’t just have to be on the main page,
  • but re-appear on subsequent pages, depending on whether
  • the user has logged in or not.
  • Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC)
  • Last Updated: August 26, 2004
    */
    include(“include/session.php”);
    ?>
StrawBIS
<div id="header">
	<div id="menu">
		<ul>
			<li><a href="index.php">Home</a></li>
			<li><a href="products.php" class="anchorclass" rel="submenu1">Products</a></li>
				<div id="submenu1" class="anylinkcss" style="background-color:#0caed1">
				<ul>
				<li><a href="product_website-interfaces.php">Website Interfaces</a></li>
				<li><a href="product_sales-grid.php">Sales Grid</a></li>
				<li><a href="product_discount-structure-tool.php">Discount Structure Tool</a></li>
				<li><a href="product_barcode-generator.php">Barcode Generator</a></li>
				</ul>
				</div>
			<li><a href="services.php" class="anchorclass" rel="submenu1">Services</a></li>
				<div id="submenu1" class="anylinkcss" style="background-color:#0caed1">
				<ul>
				<li><a href="service_solution-design.php">Solution Design</a></li>
				<li><a href="service_software-development.php">Software Development</a></li>
				<li><a href="service_report-development.php">Report Development</a></li>
				<li><a href="service_data-preparation.php">Data Preparation</a></li>
				<li><a href="service_project-managment.php">Project Managment</a></li>
				</ul>
				</div>
			<li><a href="about.php">About</a></li>
			<li><a href="contact.php">Contact</a></li>
			<li class="current_page_item"><a href="login.php">Login or Register</a></li>
		</ul>
	</div>
	<!-- end #menu -->
	<div id="search">
		<form method="get" action="">
			<fieldset>
			<input type="text" name="s" id="search-text" size="15" value="Search ..." onfocus="this.value='';" onblur="thisvalue='Search ...';"/>
			<input type="submit" id="search-submit" value="Search" />
			</fieldset>
		</form>
	</div>
	<!-- end #search -->
</div>
<!-- end #header -->
<div id="logo">
	<h1><a href="index.php">Straw Business<br> &nbsp;Information Systems</a></h1>
</div>
<hr />
<!-- end #logo -->

StrawBIS Client Login

<? if($session->logged_in){ echo "

Logged In

"; echo "Welcome $session->username, you are logged in.

"; if($session->isAdmin()){ echo "[Admin Center]   "; } echo "[Logout]"; } else{ ?>

Login or Register

<? /** * User not logged in, display the login form. * If user has already tried to login, but errors were * found, display the total number of errors. * If errors occurred, they will be displayed. */ if($form->num_errors > 0){ echo "".$form->num_errors." error(s) found"; } ?>
Username: "> <? echo $form->error("user"); ?>
Password: "> <? echo $form->error("pass"); ?>
value("remember") != ""){ echo "checked"; } ?>> Remember me next time     

Not registered? Sign-Up!
[/php]

I played around with some of the syntax’s and got one section to work.

[php]

<?php if($session->logged_in){ echo '

Logged In

'; echo 'Welcome $session->username, you are logged in.

'; if($session->isAdmin()){ echo '[Admin Center]   '; } echo '[Logout]'; }else{ echo '

You arent logged in

'; } ?>

[/php]
Added the else and also echoed, you arent logged in, because I didnt have the database setup.
And it worked. So seems to be some issues with syntax’s.

Sponsor our Newsletter | Privacy Policy | Terms of Service