Jump to content

A few xampp questions


JackPike

Recommended Posts

Ok I have my xampp up and running and everything seems to be running fine but where do I save my files to view using the localhost I have place a couple in htdocs to test but cannot view anything when I run the browser

He who simply trys, Is not trying hard enuff

Link to comment
Share on other sites

Slowly getting there with the first steps of php one thing I have learnt is to use a story board so you can rember what is what or else you will be in a mess trying to remember what each file does

Edited by JackPike

He who simply trys, Is not trying hard enuff

Link to comment
Share on other sites

The way that I use is to add comments into the files at certain sections describing what that particular section does.

 

This is a very very cut down version of one of my php files, if you look at it in an editor with syntax highlighting you`ll see that each line beginning with "//" or "/*" will not be parsed by php and will be ignored.

 

eg:

<?php// Include functions.php as it holds certain info which is neededinclude('functions.php');// See if the form had been submitted// If yes, run this section// If no, then ignore this section and continue with the nextif(isset($_POST['Submit'])){	// Grab the info from the submitted form and make safe	$town = htmlentities(mysql_real_escape_string($_POST['town']));	/* -- SNIP -- */	$species = htmlentities(mysql_real_escape_string($_POST['species']));		// Start building the MySQL Query and put it into an array	if($club_name)	{		$whereParts[] = "club_name LIKE '%$club_name%'";	}		/* -- SNIP -- */	if($closed_season)	{		$whereParts[] = "close_season = '%$closed_season%'";	}			// Put the array into $whereClause	$whereClause = implode(' OR ', $whereParts);	// Build the query	$sql = "SELECT * FROM clubs WHERE " . $whereClause;		// Connect to the MySQL server	db_connect();	// Run the MySQL query and output the results	/* -- SNIP -- */}// If the above has been ignored, then run this sectionelse{	// Grab the header and show what should be in the browser title from functions.php	show_header($title = "Search Angling Clubs");	echo '<form id="clubs_search" name="clubs_search" method="post" action="search.php">
<table width="100%" border="1">
 <tr>';

 /* -- SNIP -- */

 echo '</table>
</form>';

// Show the footer of the page
show_footer();
}

?>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We and our partners use cookies on our website to give you the most relevant experience by remembering your preferences, repeat visits and to show you personalised advertisements. By clicking “I Agree”, you consent to the use of ALL the cookies. However, you may visit Cookie Settings to provide a controlled consent.