Jump to content

Recommended Posts

HI all,

 

Complete newbie - first ever time trying to use PHP.

 

So, here's the problem - I have a piece of data I want to pass to a php page, don't want it to show in the url, so guess i need to use $_POST.

 

I've tried the following with no success - since I'm learning php at the same time I'm trying to get something to work - I feel real stooooopid - any help would REALLY be appreciated.

 

$_POST['Barid'];

// Barid will contain a 3 character code, first is a letter, next 2 are numbers eg: "A12"

 

the code then calls the next page in and I try to retrieve the info

 

$Barid = $_POST['Barid'];

 

Result is that $Barid is blank

 

I'm sooooooooo confused.

I have been working on this problem all day (over 5 hours). Seems like there aught to be a way to pass a simple variable to the next script.

 

Here is what I ended up with....

<?php

echo "Start the session....";

Session_start(); // Start the PHP session

$Barid = "A34"; // Constant for now

$_SESSION['Barid'] = $Barid; // Pass  dentifier to next page

?>

It works - THE FIRST TIME it's run!!!!!

 

When I run it again (as will happen many time in the application) I get the following error (have spent hours reading the php manual trying to figure a way out of this - no luck)

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\RickDB\h-3.php:2) in C:\xampp\htdocs\RickDB\h-3.php on line 4

 

Really - I can't see that it would be that hard to do what I want - I can think of literally dozens of ways to do it on mainframes (I've been in I.T. for over 40 years). Can anyone just show the 3 or 4 lines (probably) of code that will make this happen?

 

Thanks for all the previous help - but, well, since this is brand new to me - I just am not getting it.

 

Quadlo

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.