PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Tue Dec 12, 2017 10:57 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Wed May 19, 2004 11:20 pm 
Offline
Forum Commoner
User avatar

Joined: Wed Sep 03, 2003 7:23 pm
Posts: 71
Location: Brisbane, AUS
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


Last edited by Pointybeard on Thu May 20, 2004 7:33 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu May 20, 2004 12:45 am 
Offline
Site Admin

Joined: Thu Apr 18, 2002 3:14 pm
Posts: 1767
Location: Montreal, CA
Take a look at here (http://forums.devnetwork.net/viewtopic.php?t=511) and see if that helps solve the problem.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 20, 2004 7:57 am 
Offline
Forum Commoner
User avatar

Joined: Wed Sep 03, 2003 7:23 pm
Posts: 71
Location: Brisbane, AUS
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 :roll: 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:

Syntax: [ Download ] [ Hide ]
<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>


heres the results.

Syntax: [ Download ] [ Hide ]
Array
(
    їavar] => 100
   їinput1] => Testing the post
   їsubmit] => PRESS ME
)


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


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 20, 2004 8:03 am 
Offline
Site Admin

Joined: Thu Apr 18, 2002 3:14 pm
Posts: 1767
Location: Montreal, CA
Pointybeard wrote:
Umm, That doesnt help me. I do believe im past the Newbie101 stage of setting up a server ;)


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. :)

Syntax: [ Download ] [ Hide ]
<?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>


Could you post your mod_rewrite entries here. I have worked with it before, and I know what you have to do to get it working properly with GET vars. I can tell you know that if you don't account for it, '?avar=100' will get lost when mod_rewrite changes the URL.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 20, 2004 8:39 am 
Offline
Forum Commoner
User avatar

Joined: Wed Sep 03, 2003 7:23 pm
Posts: 71
Location: Brisbane, AUS
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.

Syntax: [ Download ] [ Hide ]
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=$1


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


Last edited by Pointybeard on Sat May 22, 2004 7:29 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sat May 22, 2004 7:27 am 
Offline
Forum Commoner
User avatar

Joined: Wed Sep 03, 2003 7:23 pm
Posts: 71
Location: Brisbane, AUS
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group