Post PHP form to non-existing page


Posted on 16th Feb 2014 07:03 pm by admin

The company that I work for host their PHP code on IIS on a Windows server, no Apache, so no mod_rewrite. I recently wrote a custom framewok that is loosely based on Codeigniter. To get SEF URL's 'n used a custom 404 page to redirect my URL's to where they should be. An example URL would be www.example.com/search. 'Search' would not be found and the script would go to the 404 page which would then redirect to my controller named search.php which in turn would load the necessary models and finally the views. This all works perfectly.

My problem however is when I use a simple html form that posts to a php file. The action is set as follows action="<php echo $BASEPATH ?>search" this path resolves to the search controller. But the big problem is this file does not exist. So I do get directed to the page, but the $_POST is empty.

Does anyone have any ideas on how to get around this? The other option is to just avoid forms alltogether and use AJAX for everything, but there has to be something that I am missing or can do different.

180 Like 33 Dislike
Previous php-forum Next php-forum
Other php-forum

Session variable help
I'm having a very troubling issue. Maybe I'm just looking over something but I have looked at the co

Session
I am having a little trouble with a session. Not sure if it is my browser or what. I know I do not

line breaks in between fetched file names
Hi,

I have this code:
Code: <?php
if($dir = opendir('files')){
while (($f

ctype() validation - allowing illegal characters
Hello,
I use ctype() to filter and validate a user form. However, I am trying to allow certain c

some questions
Hello,

I am looking for the answers for following questions:

1) Does PHP support overl

A rank users order by points
I want to make an insert from table 'rank' , with number (rank) from the cod blow, to fild users.ran

Anti Spam Code
Ok where do i start? Probably by telling you I have very little working knowledge of PHP and that I

Multi-user card game
I'm writing a batch of games and such. Lottery is finished, Poker,blackjack,etc are next. They will

md5 is it unique
I know this is most likely one of many simple questions that can be found semi easily. But I'm press

Help With Showing Users On the Index Page
Ive got this code which works just how i want it to.

Code: <?
$timenow=time();

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash