/    Sign up×
Community /Pin to ProfileBookmark

Submitting POST data without a form.

Situation:

I have a bunch of php files in the public html directory. I’d like to have a common ‘error’ page, with a parameter for displaying either the ‘not found’ or ‘hidden’ or whatever error.

But I also want to have an SQL error, which it displays when a query fails. I’d like the error page to have the query that caused the problem, so it can record it for me or whatever, but I’d rather it not be passed through the URL.

I call the error page with header(“error.php?sql”);

Is there any elegant way to POST data or otherwise make it available to the error page?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@Paul_JrAug 30.2004 — You can't POST data without a form, so you might be lookin' for [url=http://us2.php.net/manual/en/ref.session.php]good ol' sessions[/url].
Copy linkTweet thisAlerts:
@mikepurvisauthorAug 30.2004 — [i]Originally posted by Paul Jr [/i]

[B]You can't POST data without a form, so you might be lookin' for [url=http://us2.php.net/manual/en/ref.session.php]good ol' sessions[/url]. [/B][/QUOTE]


Ugh. I was afraid of that. Thanks.

*tackles sessions*
Copy linkTweet thisAlerts:
@solavarAug 30.2004 — Well, you can POST without a form IF you have cURL installed.
×

Success!

Help @mikepurvis spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...