Form action, where does yii look for this?

I am in the process of replacing out a Yii form in Yii 1 with just a regular php form.

The problem I am having is that, I can’t figure out where Yii is looking for the file when put it in the form action.

Right now I have the php file to process the form in the same folder as where the view is being stored. Where should I put the form processor php file so that Yii knows where to look for it?

<form action="contact.php" method="post">

&lt;p&gt;&lt;b&gt;Your Name*&lt;/b&gt; &lt;input type=&quot;text&quot; name=&quot;yourname&quot; /&gt;&lt;br /&gt;

&lt;b&gt;Subject*&lt;/b&gt; &lt;input type=&quot;text&quot; name=&quot;subject&quot; /&gt;&lt;br /&gt;

&lt;b&gt;E-mail*&lt;/b&gt; &lt;input type=&quot;text&quot; name=&quot;email&quot; /&gt;&lt;br /&gt;

&lt;b&gt;Body*&lt;/b&gt;&lt;textarea id=&quot;message&quot; name=&quot;message&quot;&gt;&lt;/textarea&gt;&lt;/p&gt;

&lt;p&gt;&lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;&lt;/p&gt;


So contact.php is NOT a Yii file and you want to submit the form to it?

With what you have now, the browser will submit the form to “.../path-to-your-form-controller/contact.php”. As the path/directory doesn’t exist physically, you can’t put your file there.

If you used "/contact.php" as your action, the browser would look for the file in the root of your domain.

Right, contact.php is not a YII file just a vanilla php file for email processing.

How can I set it up to say put it in the controllers folder and access it? I tried ‘../../controllers/contact.php’ but it can’t find the file. I’d like to put it in a folder so it can’t be accessed by the public instead of using /contact.php in the root.

If you want the browser to be able to send the form to contact.php, it will have to be accessible by the public.