Jump to content

Use php file instead of url in form action


blogit

Recommended Posts

I'm using phplist to handle newsletter sign ups, the action url is http://www.domain.com/lists/?p=subscribe I'd like to have the action handled by a php file instead, so anyone viewing the source wont see off hand the url in the action. I know basic form handling and using mail() with variables but how can I have the form variables sent to the url using a php file. The only thing i could come up with is below but my coding is not that great so i have no other ideas on how to pass the data to the url. Any advice is appreciated...

 

thanks

 

<?php
    if (!isset($_POST['subscribe']))
{
            ?>  <form action="http://www.domain.com/lists/?p=subscribe" method="post">
              </form><?php
}
?>

Well, one thing I see right off the bat is that your action script needs to be relative to the form page it's calling it from. If your action script is in the same directory as your form page, just use the name of the script (with, in your case, additional arguments). No need for http://..., my man :)

 

FlyingIsFun1217

The form's on the index page the script is a few folders deep the script im using is phplist i'm just trying to have a little more privacy with it, im thinking maybe just write a function that has the url and insert the php function into the action tag so you can't view it. Not the end of the world with this one, thanks for the replies

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.