Hey, Ive got modrewrite going, its, well, rewriting urls for me fine. I have a problem tho, whenever i post some data, modrewrite seems to lose the data. IE i press submit on my form which sends the data to ...../apage.htm which gets modrewrite looks at and knows i mean .../index.php?page=apage but when it gets to index.php?page=apage the POST vars are gone. Is this a consequence of the modrewrite 'redirecting'? Weird thing is tho, that on my PC server its fine. Also on webhosting for my site it is fine too. Seems that when im running the server on my iBook it lose the post vars. Its kinda annoying. Any ideas? maybe some config in httpd?? Thanks guys
-PB
Loosing POST vars with Modrewrite
Moderator: General Moderators
- Pointybeard
- Forum Commoner
- Posts: 71
- Joined: Wed Sep 03, 2003 7:23 pm
- Location: Brisbane, AUS
- Contact:
Loosing POST vars with Modrewrite
Last edited by Pointybeard on Thu May 20, 2004 7:33 am, edited 1 time in total.
Take a look at here (viewtopic.php?t=511) and see if that helps solve the problem.
- Pointybeard
- Forum Commoner
- Posts: 71
- Joined: Wed Sep 03, 2003 7:23 pm
- Location: Brisbane, AUS
- Contact:
Umm, That doesnt help me. I do believe im past the Newbie101 stage of setting up a server
I skimed over the 7 pages of posts and didnt find a reference to what im having probs with newhere, if i missed somthing, please tell me
My site runs totally without the need for globals to be on. Also i am running php4.3.6 on my PC and iBook. PC works fine. iBook doesnt. I tried a simple form post script:
heres the results.
and it works fine on the ibook. Shows me the post vars. SO, it has to be a modrewrite problem. It seems its loosing the POST vars. Ne ideas?
-pb
Code: Select all
<html>
<body>
<pre>
<?php
print_r($_REQUEST);
?>
</pre>
<form action="formtest.php?avar=100" method="POST">
<input type="text" name="input1" />
<input type="submit" value="PRESS ME" name="submit" />
</form>
</body>
</html>Code: Select all
Array
(
їavar] => 100
їinput1] => Testing the post
їsubmit] => PRESS ME
)-pb
You know, I never assume that. The moment I do, the person has not clue what HTTP stands for, and would only be using mod_rewrite because his friend told him to. Besides, you didn't provide me with any solid code, so I could only make guesses.Pointybeard wrote:Umm, That doesnt help me. I do believe im past the Newbie101 stage of setting up a server
Code: Select all
<?php
print_r($_REQUEST);
?>
</pre>
<form action="formtest.php?avar=100" method="POST">
<input type="text" name="input1" />
<input type="submit" value="PRESS ME" name="submit" />
</form>- Pointybeard
- Forum Commoner
- Posts: 71
- Joined: Wed Sep 03, 2003 7:23 pm
- Location: Brisbane, AUS
- Contact:
hehe, soz, Well....heres the .htaccess modrewrite code. I make no claims its very good. But it does the trick on my PC and the webhost. I really hate regex. hehe.
Basicly its converting URLs like this => ..../apage.htm into this => index.php?param=apage.
Oh, the avar=100 thing, thats not actually what im worried about. I was just making sure that $_GET and $_POST were working in that form. When i need to send stuff using the $_GET analogy i do somthing like .../archive/2004/05/05/news_post.htm and it gets rewritten to index.php?param=archive/2004/05/05/news_post
Thanks for the help.
-PB
Code: Select all
RewriteEngine on
RewriteBase /
RewriteRule news.rss$ http://192.168.0.15/public/pointybeard/feed/news.xml
RewriteRule (.*)\/\.(htm|html)$ http://192.168.0.15/public/pointybeard/404.htm
RewriteRule (.*)\.(htm|html)$ http://192.168.0.15/public/pointybeard/index.php?param=$1Oh, the avar=100 thing, thats not actually what im worried about. I was just making sure that $_GET and $_POST were working in that form. When i need to send stuff using the $_GET analogy i do somthing like .../archive/2004/05/05/news_post.htm and it gets rewritten to index.php?param=archive/2004/05/05/news_post
Thanks for the help.
-PB
Last edited by Pointybeard on Sat May 22, 2004 7:29 am, edited 1 time in total.
- Pointybeard
- Forum Commoner
- Posts: 71
- Joined: Wed Sep 03, 2003 7:23 pm
- Location: Brisbane, AUS
- Contact:
Well, im still no closer to finding a solution. In the mean time i've moved all my stuff to the PC server. Kinda annoying since now its not protable. I dont know if its worth mentioning, but the URLs in the address bar dont kept the nice formatting. They change to the raw format after modrewrite gets a hold of them. Kinda annoying, donno if its related. IE type http://localhost/public/pointybeard/main.htm and instead if it staying like that, it changes to ...../pointybeard/index.php?param=main
Well, if neone gets ne ideas, lemme know.
-pb
Well, if neone gets ne ideas, lemme know.
-pb