PHP POST
- Started
- Last post
- 9 Responses
- JamesEngage
I'm trying to hide part of a URL so it just shows the filename and not any ?article=fsdfsdf etc.... this page is called from another page and at the moment I am just using
window.location.replace.( ) and of course the who URL gets displayed... someone said I should use POST with PHP but not entirely sure how I am supposed to do it? Any clues?
- unfittoprint0
create an invisible form [form tags and a targget action page will be enough], include an hidden filename variable with your desired value and use a javascript to submit() the form.
- JamesEngage0
Is this what I should be doing?
repalces brackets with square ones so it'll show up[form name="redirect" action="outputit.php" method="POST"]
[input type="hidden" name='articleToLoad' value='[?php echo $articleToLoad; ?]']
[/form]all call it thus...
document.redirect.submit();
- unfittoprint0
voilá.
- JamesEngage0
hmm... not working though :(
- JamesEngage0
Do I need to do anything in the receving PHP page?
currrntly just doing this...
[?php
$articleToLoad= $_GET['A'];
?]
- unfittoprint0
u shoul use the following in the beginning of each php page
foreach ($_REQUEST as $key => $value) {
$$key = $value;
}it will creat automatically every GET/POST/COOKIE variable, namely your $articleToLoad.
- JamesEngage0
Do I need to do anything in the receving PHP page?
currrntly just doing this...
[?php
$articleToLoad= $_GET['A'];
?]It works using GET but then of course displays the string in the URL which I am trying to avoid
- JamesEngage0
Sorry for double post...browser froze half way though
- JamesEngage0
I owe you two pints :)