Jump to content

Function


j05hr

Recommended Posts

How can I make this function that once you click the link in the code it takes you to a new page without html but so the menu_name and content load in it.

 

function public_navigation($sel_subject = null, $sel_page = null) {  
	$subject_set = get_all_subjects();
	// 5. Use returned data
	while ($subject = mysql_fetch_array($subject_set)) { 

	echo "<div class=\"menu-name\">";  echo "<a href=\"buying.php?page=" . urlencode($subject["id"]) .
		"\">{$subject["menu_name"]}</a>";  echo"</div>";
	echo "<div class=\"buying-text\">";  echo "{$subject["content"]}";  echo"</div>";

	echo "<div class=\"image\">"; echo"</div>";




	}
}

 

Thanks, Josh

Link to comment
https://forums.phpfreaks.com/topic/180499-function/
Share on other sites

Do you mean remove the other code and use this instead or add this in somewhere? Also is the bracket after the else meant to be a curly brace?

 

Yes you are correct it was meant to be a curly brace.

 

What my code is saying is, if there is a paramter in the URL the only display this data for the house in the URL, else there are no paramters in the URL so display the default list of all houses.

Link to comment
https://forums.phpfreaks.com/topic/180499-function/#findComment-952478
Share on other sites

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.