Welcome, Guest. Please login or register.
Did you miss your activation email?
May 24, 2012, 11:00:29 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155448 Posts in 21704 Topics by 7731 Members
Latest Member: zvaigzdzius
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: [help] WB form handling  (Read 566 times)
sitorush

Offline Offline

Posts: 7


« on: November 04, 2008, 04:51:14 PM »

hello all,

I have form problem in wb. i cannot use the form module because it return null if form action's post so i made experiment with code module:

Code:
$mixed_output = <<< EOT
<form name="test" method="post" action="/pages/form.php">
    <input type="text" name="test" /> <input type="submit" value="submit" name="submit" />
</form>
EOT;
echo $mixed_output;
echo (isset($_GET['POST']))?$_GET['POST']:'';

It return nothing if method "post" but return value if action with "get"
am really confused. How this is happen with my WB? How can i fix this?

Thank you for your time
Logged
Casso

Offline Offline

Posts: 7


« Reply #1 on: December 01, 2008, 12:34:04 AM »

I'm having the same issue trying to access post data - does anyone have any answers?

Cheers,
Cass
Logged
Casso

Offline Offline

Posts: 7


« Reply #2 on: December 12, 2008, 02:32:21 AM »

I found the solution somewhere else. 

Update the form module's view.php: After the line '// Submit form data' add:
$_SESSION['last_post']=$_POST;

Then create a code page and set it as the 'success' page for your form.  Add the following code at the top:
$posted_data =$_SESSION['last_post'];

This creates an array ($posted data) and you can get your post back data from there, although the field numbers are skewed (your first field is actually called 'field6').

For example:
$first_field = $posted_data['field6'];
$second_field = $posted_data['field7'];

and so on
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!