ayuda estructura de un php

soniderot

Bovino maduro
#1
Estaba viendo un ejemplo de pushState alguien me podia ayudar a interpretar el php de esta pagina http://html5.gingerhost.com/ en ella usa un content.php
segun se es un metodo de la forma:
Código:
<?

switch($_GET['page'])  {
    case '#page1' : $page = '<b>Introduction</b><ul><li>History support, solved ajax Back Button limitation with jquery.history.js</li><li>Bookmark support. Using hash value to identify a specific page and load it</li><li>It\'s AJAX/AHAH! It\'s cool and cutting edge!</li><li>This tutorial can be used as a kickstart for your AJAX based web development project. Small ajax based content like autocomplete and check username are basically using the same concept.</li></ul><br/>'; break;

    case '#page2' : $page = '<b>Portfolio</b><br/>You can put whatever you want. For advance programmers, you can create your own simple backend that store web pages, and then display it by using PHP to retrieve it from database. Also, you can integrate a Rich Text Editor for your backend too! I have made a post regarding <a href="http://www.queness.com/post/212/10-jquery-and-non-jquery-javascript-rich-text-editors">Rich Text Editor</a>.<br/><br/> Starting from a simple guideline, you can build your own Content Management System.'; break;

    case '#page3' : $page = '<b>About</b><br/>This is a simple AJAX-Based website created by Kevin from Queness.com. General speaking, we shouldn\'t call this as AJAX (Asynchronous Javascript and XML) because there is no XML data. Instead of AJAX, we should call it as AHAH.<br/><br/><b>Asychronous HTML and HTTP aka AHAH</b><br/>AHAH is a technique for dynamically updating web pages using JavaScript, involving usage of XMLHTTPRequest to retrieve (X)HTML fragments which are then inserted directly into the web page. Inspite of retreiving XML, AHAH stands for retreiving (X)HTML. It\'s a subset of AJAX.'; break;

    case '#page4' : $page = '<b>Contact</b><br/>This form is just a demostration of what content you can put.<br/><br/><form>Name:<br/><input type="text"/><br/>Email:<br/><input type="text"/><br/>Message:<br/><textarea></textarea><br/><input type="button" value="Send"></form>'; break;

}

echo $page;
?>
 

soniderot

Bovino maduro
#2
mmmmmmmmm ok parte de la ayuda del creador de la web...
http://html5.gingerhost.com/content.php?cid=seattle&format=json
{"title":"Seattle - Part of a demo for #ProSEO","h1":"Seattle","article #articletext":"Seattle is the northernmost major city in the contiguous United States, and the largest city in the Pacific Northwest and the state of Washington. It is a major seaport situated on a narrow isthmus between Puget Sound (an arm of the Pacific Ocean) and Lake Washington, about 114 miles (183 km) south of the Canada - United States border, and it is named after Chief Sealth \"Seattle\", of the Duwamish and Suquamish native tribes. Seattle is the center of the Seattle-Tacoma-Bellevue metropolitan statistical area--the 15th largest metropolitan area in the United States, and the largest in the northwestern United States.<\/p>
Seattle is the county seat of King County and is the major economic, cultural and educational center in the region. The 2010 census found that Seattle is home to 608,660 residents within a metropolitan area of some 3.4 million inhabitants. The Port of Seattle, which also operates Seattle-Tacoma International Airport, is a major gateway for trade with Asia and cruises to Alaska, and is the 8th largest port in the United States in terms of container capacity.<\/p>","#image":"
"}
 

dgr182

Bovino maduro
#3
Ese PHP, recibe un parametro enviado desde la pagina por medio del Metodo GET con el nombre de "page", ese debe contener dentro los valores de : #page1 o #page2 o #page3 o #page4, de acuerdo al que contenga dentro va a desplegar con la funcion ECHO lo que esta despues de case '#page1': (si fue #page1), y lo despliega con la funcion echo por que el texto se asigna ala variable $page de acuerdo al CASE en el cual cayo el Switch.

Suerte, leete mas sobre php (switch) y jquery.
 

soniderot

Bovino maduro
#4
el de page si lo entiendo por que tengo el codigo el de abajo no lo entiendo ya que consta de variables extrascomo &format=json mmmm pero gracias en molestarte en ayudar u.u
 
Arriba