Jump to content

Auto database login for webform


xilllly

Recommended Posts

Hi, I'm trying to get a php webform to log onto the database automatically before it loads on the website page. In other words I don't want the customer having log onto the database or be a guest. I think I need the code below to do that. Question is, can I just add this code into the php file that is the webform or add the <?php            ?> to it and have it above the webform php code.

Also do I need to alter any other dbconnect php pages as well?

Also do I need to edit the htaccess file also.

 

 

 

function verify_code()

{

 

 

$connection = mysql_connect ("localhost", "fred", "kool3401") or die ('Error: ' . mysql_error());

$db = mysql_select_db ("october");

 

  {

    echo "Authenticated";

  }

 

 

Many Thanks

Link to comment
https://forums.phpfreaks.com/topic/217999-auto-database-login-for-webform/
Share on other sites

I think he just wants the webpage to have access to the DB using the id/pw that is already setup for DB access.

 

So basically yes, you just need the proper connect string to allow the webpage to write to your database.

 

But without seeing your other code, no one can tell you if what you posted above will work or not as it is.

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.