How to solve the problem of page pass value

Source: Internet
Author: User
I want to upload a value to a page. For example, text. php & lt; ahref & quot; test. php? Id]; echo $ tt ;? & Gt; after entering the page, first judge if there is a value passed in, execute code 1, if there is no value passed in, execute code 2 this judgment is not good, do not know how to determine the page to pass the value
I want to upload a value on a page.
For example, text. php
Link
$ Tt = $ _ GET ['id'];
Echo $ tt;
?>
After entering the page, first determine if there is a value passed in, execute code 1, if there is no value passed in, execute code 2
I don't know how to judge this.
I have also seen other people's pages. a page with many passing values is its own, such as www.xxx.com/edit ....
What is the idea?
I often write a function. Do I have to write several php pages?

------ Solution --------------------
If (isset ($ tt ))
Code 1
Else
Code 2
------ Solution --------------------
Hello, www.xxx.com/edit....this form uses the framework technology, and I personally understand ZF (ZendFramework ). A framework technology in MVC mode can implement your ideas without using a large number of PHP files to implement a function.
There is a very good, very famous ZF entry Demo, address is http://akrabat.com/zend-framework-tutorial/

You can download his source code and PDF tutorials to learn the framework. then you will find that it will achieve the desired effect without knowing it! Success!
------ Solution --------------------
After entering the page, first determine if there is a value passed in, execute code 1, if there is no value passed in, execute code 2
PHP code
If (! Empty ($ _ GET ['id']) {// execute a $ id = intval ($ _ GET ['id']); include ('. /. php ');} else {// execute B include ('. /B. php ');}

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.