/    Sign up×
Community /Pin to ProfileBookmark

getting HTTP data in a form input value using only html

please read twice before answering as it may confuse you.

Here is what I have now —

My webhost allows for custom error pages (which I like and use)
[INDENT]Problem — the page must be named errnum.shtml (e.g. 404.shtml) this is the only way the custom pages work. however all my pages in my site are php.[/INDENT]

I have found that I can use

[code]<meta HTTP-EQUIV=”REFRESH” content=”1; url=error.php”>[/code]

to redirect to my real php error page on which I have built a error submit form which I would like to get all the HTTP data (requested page, referring page, browser, etc.) sent as well as a user’s email addy (if they wish to have an answer back) and any comments they need to make or a question re: the error encountered.

using this format is not acceptable as the requested page comes up as /error.php (from the redirect NOT the original requested page) this does not help at all (bogus data)

how I found that I can insert

[code]<!–#echo var=”REQUEST_URI” –>[/code]

and it will show on the shtml page (does not submit form but provides the correct data) but submitting he form to the PHP page the data is blank.

the shtml page has this for code

[code]<form id=”submiterror” action=”error.php” method=”post”>
<table summary=”404 submission information” align=”center”>
<tr><td class=”left”>Requested Page:</td><td class=”right”><!–#echo var=”REQUEST_URI” –></td><td class=”right”><input name=”reqURI_1″ type=”hidden” value=”<!–#echo var=””REQUEST_URI”” –>” /></td></tr>
<tr><td class=”left”>Referring Page:</td><td class=”right”><!–#echo var=”HTTP_REFERER” –></td><td class=”right”><input name=”RefURL_1″ type=”hidden” value=”<!–#echo var=””HTTP_REFERER”” –>” /></td></tr>
<tr><td class=”left”>Your IP Address:</td><td class=”right”><!–#echo var=”REMOTE_ADDR” –></td><td class=”right”><input name=”visIP_1″ type=”hidden” value=”<!–#echo var=””REMOTE_ADDR””‘ –>” /></td></tr>
<tr><td class=”left”>Your Browser:</td><td class=”right”><!–#echo var=”HTTP_USER_AGENT” –></td><td class=”right”><input name=”visbrow_1″ type=”hidden” value=”<!–#echo var=””HTTP_USER_AGENT”” –>” /></td></tr>
<tr><td class=”left”>Server Name:</td><td class=”right”><!–#echo var=”HTTP_HOST” –></td><td class=”right”><input name=”svrname_1″ type=”hidden” value=”<!–#echo var=””HTTP_HOST”” –>” /></td></tr>
<tr><td class=”left”>&nbsp;</td><td class=”right”>&nbsp;</td><td class=”right”><input name=”redirectcode_1″ type=”hidden” value=”<!–#echo var=””REDIRECT_STATUS”” –>” /></td></tr>
<tr><td class=”left”>&nbsp;</td><td class=”main”><input type=”submit” value=”Send Error Report” /></td><td class=”right”>&nbsp;</td></tr>
</table>
</form>
<script language=”JavaScript” type=”text/javascript”>
<!–
document.forms(“submiterror”).submit()
//–>
</script>[/code]

to see it formatted go to [url]http://www.mainenotarynet.com/ish[/url]

this will produce an error and the data will be correct on the page as it shows the data that is going to be submitted but does not allow changes (note the Inputs are hidden)

The values show on the screen in the 2nd <td>s as they are just displaying and not input values.

The 3rd <td>s are the inputs and getting this data in the value=” ” attribute is where I am encountering problems.

I have tried:

[LIST]

  • [*]

    value= with single quotes to leave the inner var= with the double quotes


  • [*]

    value= with doubles and cahnging the var= to singles


  • [*]

    value= and var with dobles which is what the copy/paste would do


  • [/LIST]

    I found the script to auto-submit the form (which btw does not work (commented put the meta tag) to test it

    What I need —

    I need the data from the 404.shtml file (correct data) form to be processed by the error.php file (using $_POST[‘variable’] to show/input the data [now shows as blank]) and then the REAL error.php page will TRUELY be prossessed and send me an email of the error using phorm and sendmail()

    the error page itself can be found at [url]http://www.mainenotarynet.com/error.php[/url]
    The form is at the bottom of the page (if you view source it)
    This did work when using the php variants of the $_SERVER[‘varnames’] variant of the #echo statements in the shtml code above although the data was bogus for the referrer (always came up blank) and re quested page (always showed /error.php)

    this MUST be in HTML NOT php/c+/javascript as the shtml page needs to autosubmit the REAL info to the REAL error page

    Any suggestions in doing this is greatly appreciated and welcomed but please understand what I need BEFORE answering as I must have my error page in .shtml for with either the META redirect – (which would cause a blank form as the form would never be submitted – unless in that META tag is an option I can add to auto-submit) to the true php page

    a javascript to auto submit – since the one I copied does not work in the shtml page.

    Thank You
    Kevin M Carman
    Maine Notary Net
    Bangor, ME

    to post a comment
    HTML

    0Be the first to comment 😎

    ×

    Success!

    Help @mainenotarynet 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 6.15,
    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: @nearjob,
    tipped: article
    amount: 1000 SATS,

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

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...