Results 1 to 4 of 4

Thread: Custom PHP forms

  1. #1
    New user
    Join Date
    07-14-09.
    Posts
    2

    Default Custom PHP forms

    Hi,
    I am wanting to run a custom form written in PHP from within an article.
    I have placed the php file in the templates folder and used the insert tag:
    {{file::contact.php}}
    in the article's HTML area.

    This works fine, but on submitting the form I get the 403 error:
    Forbidden

    You don't have permission to access /RMCTypolight/templates/contact.php on this server.

    The form action calls the file contact.php, i.e. the same php file that the form resides in.

    Anyone able to help?

  2. #2
    User MacKP's Avatar
    Join Date
    06-19-09.
    Location
    Duisburg (Germany)
    Posts
    211

    Default Re: Custom PHP forms

    Hi gregu,
    i never made something like that. But i think you must use the link (the submitting) again to an TL side and an inserttag. The same page as the form is in I think.
    Otherwise you would be abel to use that file without an inserttag at the first time ;-)

    regards
    Mediendepot Ruhr
    For real-time chat the (inofficial) Chatroom in IRC:
    -> irc.freenode.net #contao | irc.freenode.net #contao.de

  3. #3
    User
    Join Date
    06-19-09.
    Location
    Kosice, Slovakia
    Posts
    61

    Default Re: Custom PHP forms

    Access to files in template directory is forbidden by .htaccess in that directory and you shouldn't try remove it, as it is important for security.

    Just make sure that form action points to typolight page containing your form. I believe action="#" will work fine. Then just check if form was submitted and do whatever you want in your contact.php.
    S.C.A.R.E

  4. #4
    New user
    Join Date
    07-14-09.
    Posts
    2

    Default Re: Custom PHP forms

    Thanks for the replies. I ended up solving it by using action="$_SERVER[PHP_SELF]" in the form tag ("#" did not work for me).

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •