Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Means of passing variable from 1 page to another.

Status
Not open for further replies.

bdichiara

Programmer
Oct 11, 2006
206
US
Ok, I'm running into a slight problem.

I'm using an application called HTMLDOC which generates PDFs from webpages (or HTML). Everytime I pass a variable through the url to this application, i get an error. What other means are there of passing a variable from one page to another.

I've tried using:
$_GET
setcookie
$_SESSION

All of these produce negative results. One last method I haven't tried, which I will try next, is writing a 1/0 to the database and pulling that record out. That just seems a little too complicated for what I'm trying to accomplish.

Are there any other ways of getting a variable from 1 page to another (besides POST and using globals on)?

_______________
_brian.
 
besides POST and using globals on
Why would you ever want register_globals turned on?


Anyway, insufficient data for a meaningful answer. "I get an error" is vague.


I have successfully used session variables to transfer data between successive scripts when those scripts output HTML, plain text, JPEGs, PNGs and PDFs.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Ok, i must've been doing something wrong. I gutted all the sessions code and started over, and now the session variable works. Thanks.

_______________
_brian.
 
If you tell us what error you reported earlier, perhaps one of us can tell you what happened with your code. That way, you won't have to fumble blindly to bypass the error next time you see it.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Well, the error was specific to HTMLDOC, I believe, and not sure if this forum is the right place for that. But if I recall it was something like:

File does not begin with '%PDF-'.

_______________
_brian.
 
Although now that I think about it some more, that HTMLDOC error could be easily caused by a PHP error. If a PHP script bug caused a warning or error to be output, then that could be why the document does not begin with "%PDF-".

One technique that could help you debug this error is described in section 2.6 of faq434-2999. If you use telnet to fetch the document, you might be able to see exactly what, instead of "%PDF-" was output first. If that first output's a PHP error, you now can correct code.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top