Create a dynamic WML site (3)

Source: Internet
Author: User
Then, you must enter it in the next file (index3.wml. We ask the user to enter the subject name or the professor's surname. Pay attention to how variables are transmitted between pages. The syntax seems a bit complex, but it helps you understand how the entire process is completed through several files. & Lt ;? Php (as the current master SyntaxHighlighter. all (then the user must input it in the next file (index3.wml. We ask the user to enter the subject name or the professor's surname. Pay attention to how variables are transmitted between pages. The syntax seems a bit complex, but it helps you understand how the entire process is completed through several files.
<? Php (as the mainstream development language)
Header ("Content-type: text/vnd. wap. wml ");
Header ("Cache-Control: no-cache, must-revalidate ");
Header ("Pragma: no-cache ");
Echo ("<? Xml (standardization is getting closer and closer) version = 1.0?>; ");
>;
<! DOCTYPE wml PUBLIC "-// WAPFORUM // dtd wml 1.1 // EN"
"Http://www.wapforum.org/DTD/wml_1.1.xml (standardization is getting closer and closer)" >;< WML>
<CARD id = card3 title = Name>
<? Php (as the mainstream development language)
Echo ("<p> Insert ");
If ($ {$ choice }== "surname "){
Echo ("professors surname (or part of it). n ");
} Else if ($ {$ choice }== "subject "){
Echo ("the subject (or part of it). n ");
} Else {
Echo ("Maybe there is some problem. n ");
} Echo ("<INPUT name =" $ {$ choice} "type =" text "> ");

?>
<DO type = "text" label = "Go">
<GO href = "query. wml" method = "get">
<? Php (as the mainstream development language)

Echo ("<POSTFIELD value =" $ "." $ choice "." "/name =" $ choice "> ");

Echo ("<POSTFIELD value =" $ "." $ {$ choice} "." "/name =" $ {$ choice} "> ");

?>
</GO>
</DO>
<P> </P>
</CARD>
</WML>



<DO type = "text" label = "Go">
<GO href = "index3.wml # card3" method = "get">
<? Php (as the mainstream development language)
Echo ("<POSTFIELD value =" $ "." $ choice "." "/name =" $ choice "> ");
Echo ("<POSTFIELD value =" $ choice "/name =" choice "> ");
?>



</CARD>
</WML>
Write query code

The following files process queries. Its name is query. wml. we will analyze it in more detail.

<? Php (as the mainstream development language)

Header ("Content-type: text/vnd. wap. wml ");
Printf ("<? Xml (standardization is getting closer and closer) version = "1.0"?> N ");
Printf ("n ");
Printf ("n ");


// The following lines are used to construct SQL statements for query teaching time


$ Consulting_tables =
"(Professors left join teach on (professors. Id = teach. Id), subjects )";
$ Consulting_columns =
"Professors. Surname, professors. Name, subjects. Subject ,";
$ Consulting_columns. =
"Subjects. Cod_number, professors. Consulting_hour, professors. Consulting_place ";
$ Consulting_query =
"Subjects. Cod_Subject = teach. Cod_subject ";


// The following lines are used to construct an SQL statement for the query time

$ Exams_tables = "(exams left join professors ON (exams. Id = professors. Id), subjects )";
$ Exams_columns = "subjects. Subject, subjects. Cod_number, professors. Surname ,";
$ Exams_columns. = "professors. Name, exams. Date, exams. Time, exams. Room, exams. Test ";
$ Exams_query = "exams. Cod_Subject = subjects. Cod_Subject ";

// The following rows are SQL statements used to query the test time table to add query restrictions.


If ($ exams_data ){

Switch ($ exams_data ){
Case "subject ":
$ Exams_query. = "and subjects. Subject like % $ subject % ";
Break;
Case "surname ":
$ Exams_query. = "and professors. Surname like % $ surname % ";
Break;
}
}


// The following rows are used to add query restrictions for SQL statements that query the teaching time.

If ($ consulting_data ){
Switch ($ consulting_data ){

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.