Current location: Hot Scripts Forums » Programming Languages » PHP » How can I to get the value of a text box from previus form?


How can I to get the value of a text box from previus form?

Reply
  #1 (permalink)  
Old 07-06-05, 08:14 PM
jozin jozin is offline
Newbie Coder
 
Join Date: Oct 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
How can I to get the value of a text box from previus form?

Hi to all,

I got this problem. I can't get the value of a text box from the other form.

Ex. I viewing the basic info of employee 1 in the current form. I want to edit his educational background by clicking a link but the IDno and Name is not displayed in the other form.


I tried to check the value of IDno this way.

PHP Code:

     if (empty($_POST['IDno'])) {

        
$sn FALSE;
       } else {
        
$sn $_POST['IDno'];
     }
     echo 
$sn
$sn is empty.

Is there an easy way to do it?
Any help or suggestion is very much appreciated.

Thanks a lot and more power.

jozin.
Reply With Quote
  #2 (permalink)  
Old 07-06-05, 08:59 PM
DetroitGuy DetroitGuy is offline
Newbie Coder
 
Join Date: Jun 2005
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Create a session and a variable for $_POST['IDno'].


PHP Code:

<?php

// start the session
session_start();
header("Cache-control: private"); //IE 6 Fix

// Get the user's input from the form
   
$id $_POST['IDno'];

// Register session key with the value
   
$_SESSION['IDno'] = $id;

// Display the session information:
//
//
?>
Reply With Quote
  #3 (permalink)  
Old 07-06-05, 11:18 PM
jozin jozin is offline
Newbie Coder
 
Join Date: Oct 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Hi DetroitGuy,

Just to clarify, where will I put the session, in the second form or in the first?
anyway, thanks for the help. Its my first time to use session.

Reply With Quote
  #4 (permalink)  
Old 07-07-05, 08:22 PM
jordie jordie is offline
Wannabe Coder
 
Join Date: Jun 2005
Posts: 179
Thanks: 0
Thanked 0 Times in 0 Posts
DetroitGuy: Can you give me more info about that IE 6 fix? Perhaps a link to an article about it? Thanks.
__________________
Jordie Bodlay
php, mysql, postgres
css, xhtml
graphics, design
email me: jb2386@hotmail.com for any programming needs.
Reply With Quote
  #5 (permalink)  
Old 07-07-05, 08:48 PM
DetroitGuy DetroitGuy is offline
Newbie Coder
 
Join Date: Jun 2005
Posts: 83
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Microsoft Internet Explorer Sessions Fix

There is one other little tricky issue I must tell you about. Since we all know even though Microsoft makes every attempt to dominate the world, their software still has issues. Let's take IE 6 for example. There's a problem with IE6 that when you are using sessions and you post to a form, when you click your back button to make changes in the form, you have to click the REFRESH button on that page to get the information that you posted back into the form. This only works about 50% of the time, the other 50% the users information is lost and they have to type it over again. Not a good thing if you are trying to get the person to enter their billing information to process an order. They might just get irritated and leave. So, here's a solution for that. Enter this right below the session_start() of each script (yes it still must be before anything is output to the browser).
http://www.phpfreaks.com/tutorials/41/1.php
Reply With Quote
  #6 (permalink)  
Old 07-11-05, 02:14 AM
jozin jozin is offline
Newbie Coder
 
Join Date: Oct 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
hi DetroitGuy,

thanks a lot for your help. I appreciate it very much.

Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can i copy the value from Pulldown menu to Text Box ishaqani JavaScript 1 05-25-04 08:13 AM
text box altafingar Visual Basic 2 05-08-04 10:20 PM
Visual basic text box altafingar Visual Basic 2 04-30-04 08:49 AM
MySQL Query problem Wraith PHP 5 03-06-04 05:16 PM
picking random entries with a filter... Double selection problem dsumpter PHP 7 11-16-03 07:19 PM


All times are GMT -5. The time now is 06:54 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.