Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
help needed in passing object to another page
Old 02-11-2010, 03:19 PM help needed in passing object to another page
Junior Talker

Posts: 3
Trades: 0
I want to pass the result of a function to another page. As the result is a PDOstatement object, I cannot use serialize(). The code is below.

if (isset($_GET['action']) && $_GET['action'] == 'getResultofParent' && isset($_POST['keyword']))
{
$result=getResultofParent($_POST['keyword']);
header("Location: http://localhost:100/test/viewnoofvisit.php/?result=".$result);
}

Please help me
thanks in advance
phpquery is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-11-2010, 03:25 PM Re: help needed in passing object to another page
dark_lord's Avatar
Experienced Talker

Posts: 41
Name: Parijat Roy
Location: INDIA-KOLKATA
Trades: 0
i don't think you can pass an array using get/post method. i think you need session.
__________________
I AM THE BEAUTIFUL NIGHTMARE

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
dark_lord is offline
Reply With Quote
View Public Profile Visit dark_lord's homepage!
 
Old 02-11-2010, 03:36 PM Re: help needed in passing object to another page
lynxus's Avatar
Awesomeo-Maximo

Posts: 1,618
Location: UK
Trades: 1
Use session as teh guy above mentioned.
Its more secure also as people wont see it in your get request.

IE:
chuck
PHP Code:
session_start(); // at the top of your php file

//Then:
$result=getResultofParent($_POST['keyword']);

$_SESSION['result1'] = $result
On the other page,
do


PHP Code:
session_start();
$result $_SESSION['result1']; 
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE



Last edited by lynxus; 02-11-2010 at 03:39 PM..
lynxus is offline
Reply With Quote
View Public Profile Visit lynxus's homepage!
 
Old 02-11-2010, 08:02 PM Re: help needed in passing object to another page
Junior Talker

Posts: 3
Trades: 0
Thanks for your help
phpquery is offline
Reply With Quote
View Public Profile
 
Old 02-24-2010, 02:44 AM Re: help needed in passing object to another page
Junior Talker

Posts: 3
Trades: 0
This also not works for me
session variable cannot store PDO statement results!
phpquery is offline
Reply With Quote
View Public Profile
 
Old 02-24-2010, 03:01 AM Re: help needed in passing object to another page
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
A resource cannot be serialized and hence cannot be stored in a session or passed as a url parameter. What you can do instead is pass the value of $_POST['keyword'] to the next page and call getResultofParent on it then.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Reply     « Reply to help needed in passing object to another page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.43640 seconds with 12 queries