Jump to content

PHP variable within a form


pacman99

Recommended Posts

Hi,
I'm not sure this is possible and I'm no expert php programmer so hopefully this question isn't too stupid.

Basically what I want to do is use a php variable within a form.

[code]<form>
<input type="hidden" name="blah" value=(PHPVARIABLEHERE) >
</form>[/code]

the PHP variable i'm trying to use is PHP_AUTH_USER and PHP_AUTH_PW but not sure how to go about doing it? If I use
[code] value=<?php $_SERVER['PHP_AUTH_USER'] ?> [/code]
it doesn't work.

Any ideas?

Basically i'm trying to get the username and password data from the server (used to access the page using .htaccess) and implementing it so it automatically logs someone into the phpBB2 forum I have.

Thanks~
Link to comment
Share on other sites

[!--quoteo(post=370002:date=Apr 29 2006, 09:26 PM:name=michaellunsford)--][div class=\'quotetop\']QUOTE(michaellunsford @ Apr 29 2006, 09:26 PM) [snapback]370002[/snapback][/div][div class=\'quotemain\'][!--quotec--]
sounds like your web host has PHP turned off on your account. That, or your file is named with the ".html" extension instead of ".php"
[/quote]

nevermind, hooker's code works fine. Thanks a lot. Just a minor stupid error on my part (I named the file with an .html extension rather than php...yep that was stupid)
Link to comment
Share on other sites

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.