Session_start () [function. Session-start]:

Source: Internet
Author: User
I am learning PHP. When I try to do this in session_start ()-to get the error message, I cannot send session cookies.


I have seen the problem above, but I still cannot determine my error.


What if it's wrong?
<? PHP
Session_start ();
If ($ _ post ['add'])
{
Foreach ($ _ post ['A _ qty '] as $ k => $ V)
{
$ _ Session ['cart'] [$ K] = $ _ session ['cart'] [$ K] + $ V;
}
}
?>
<? PHP
// Look for catalog file
$ Catalogfile = "catalog. dat ";
// File is avaialbe, extract data from it and place into $ catalog, with SKU as key
If (file_exists ($ catalogfile ))
{
$ DATA = file ($ catalogfile );
Foreach ($ data as $ line)
{
$ Linearray = explode (":", $ line );
$ SKU = trim ($ linearray [0]);
$ Catalog [$ SKU] ['desc'] = trim ($ linearray [1]);
(Www.111cn.net) $ catalog [$ SKU] ['price'] = trim ($ linearray [2]);
}
}
Else
{
Die ("cocould not find the catalog file ");
}
?>
<Table border = "1" cellspacing = "10">
<? PHP
// Print items from the catalog for selection
Foreach ($ catalog as $ k => $ V)
{
Echo "& lt; tr & gt; <TD colspan = 2 width = 750 & gt ";
Echo "<B>". $ V ['desc']. "</B> ";
Echo "</TD> </tr> ";
Echo "<tr> <TD> ";
Echo "price per unit:". $ catalog [$ K] ['price'];
Echo "</TD> <TD> quantity :";
Echo "<input size = 4 type = text name =" a_qty [". $ K."] "> ";
Echo "</TD> </tr> ";
}
?>
From: http://www.111cn.net/phper/21/2de12f9039ff28ce01ffa0e274bb51f3.htm

Session_start () [function. Session-start]:

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.