Wrox Programmer Forums
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 6th, 2008, 02:48 AM
Registered User
 
Join Date: Feb 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Session error

Hello

I keep receiving the following errors on my last page of a small shopping cart.
Notice: Undefined index: memberorg in /mounted-storage/home71a/sub001/sc34452-WJYA/www/webshop/thankyou.php on line 65

Notice: Undefined index: memberid in /mounted-storage/home71a/sub001/sc34452-WJYA/www/webshop/thankyou.php on line 66

Notice: Undefined index: memberorg in /mounted-storage/home71a/sub001/sc34452-WJYA/www/webshop/thankyou.php on line 65

Notice: Undefined index: memberid in /mounted-storage/home71a/sub001/sc34452-WJYA/www/webshop/thankyou.php on line 66

This is the thank you page which sends all data to my mail box and also to the shopper. The cart is set up in 3 pages; product/customer/checkout. The error I'm receiving refers to two text fields on the product page and this is the session code I have on it

<?php
session_start();

if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
   $_SESSION['memberorg'] = $_POST['memberorg'];
   $_SESSION['memberid'] = $_POST['memberid'];
}
$shipname = isset($_SESSION['memberorg']) ? $_SESSION['memberorg'] : '';
$shipaddress = isset($_SESSION['memberid']) ? $_SESSION['memberid'] : '';

?>

The two fields have an echo string ...
value="<?php echo $memberorg; ?>"

(same on the other two pages) but somehow I must be missing something on the product page ???

Thanks alot (I'm a freshman in PHP)

 
Old February 6th, 2008, 07:36 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hi
try to use like following

$x=$_POST['memberorg'];
$y=$_POST['memberid'];
$_SESSION['memberorg'] = $x;
$_SESSION['memberid'] = $y;

surendran
(Anything is Possible)
http://ssuren.spaces.msn.com
 
Old February 7th, 2008, 11:57 PM
Registered User
 
Join Date: Feb 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

Thanks for your reply. I tried but it still gives me the error

OK, this is the code on the thank you page that picks up all the data from 3 previous pages and send email ...

function SendEmail($mailto, $subject, $title, $orderid, $timestamp, $maskcardno)
{
   $header = "From: [email protected]"."\r\n";
   $header .= "Reply-To: [email protected]"."\r\n";
   $header .= "MIME-Version: 1.0"."\r\n";
   $header .= "Content-Type: text/plain; charset=utf-8"."\r\n";
   $header .= "Content-Transfer-Encoding: 8bit"."\r\n";
   $header .= "X-Mailer: PHP v".phpversion();

   $message = $title."\r\n"."\r\n";
   $message .= "Order ID: PS".$orderid."\r\n";
   $message .= "Order Date: ".$timestamp."\r\n"."\r\n";

   $message .= "Membership info:"."\r\n";
   $message .= "MemberOrg: ".$_SESSION['memberorg']."\r\n";
   $message .= "MemberID: ".$_SESSION['memberid']."\r\n";

   $message .= "Customer info:"."\r\n";
   $message .= "Fullname: ".$_SESSION['fullname']."\r\n";
   $message .= "Company: ".$_SESSION['company']."\r\n";
   $message .= "Industry: ".$_SESSION['industry']."\r\n";
   /// still more data but not added here ///

The red two lines are data from the first page and this is the php code ...

<?php
session_start();

if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
   $_SESSION['memberorg'] = $_POST['memberorg'];
   $_SESSION['memberid'] = $_POST['memberid'];
}
$shipname = isset($_SESSION['memberorg']) ? $_SESSION['memberorg'] : '';
$shipaddress = isset($_SESSION['memberid']) ? $_SESSION['memberid'] : '';

?>

The referring text fields have this string ...

<input type="text" id="Editbox2" style="position:absolute;left:68px;top:2px;width:1 50px; color:#330066; font-family:Arial;font-size:11px;z-index:16" size="70" name="memberorg" value="<?php echo $memberorg; ?>" tabindex="1">

This is the same for the pages 2/3. Only page 1 doesn't want it. I'm going nuts here ...


 
Old February 8th, 2008, 12:12 AM
Registered User
 
Join Date: Feb 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi again

You may want to follow this link http://www.china-biz21.com/webshop/prdpay1.php and do a mok rego. You'll see the error at the end.

Thanks alot for the help :)

 
Old February 14th, 2008, 01:12 AM
Registered User
 
Join Date: Feb 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Please take me off this forum and erase my post. There is no point being on it.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Session error message ire Beginning PHP 4 July 4th, 2006 08:50 AM
error:(session expired) hara_sap Servlets 0 March 18th, 2005 05:54 AM
Session Error :( andrewjf PHP How-To 2 January 19th, 2005 04:15 PM
Session Error in PHP Randhy MySQL 8 December 17th, 2004 07:49 AM
mapi.session error louisantony Beginning VB 6 1 January 26th, 2004 11:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.