Jump to content

xilllly

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Posts posted by xilllly

  1. Hi, I'm trying to copy some values from a table called "member" to a table called "report" when new members submit a php application form. I can't see what's wrong with it. I have attached screenshots of the 2 tables and their structure. Any help would be much appreciated.

     

    global $conn,$dal;

    $customerID = mysql_insert_id();

    $strSQLInsert = "insert into report (appID, memberID, select_agent, agent_details, first_name, last_name, street_address, suburb, postcode) values (".$ID.", ".$ID.", '".$values["select_agent"]."', '".$values["agent_details"]."', '".$values["first_name"]."', '".$values["last_name"]."',  '".$values["street_address"]."', '".$values["suburb"]."', '".$values["postcode"]."')";

     

    db_exec($strSQLInsert,$conn);

     

     

    [attachment deleted by admin]

  2. After much trial & error plus a lot of research, the solution to my problem was to tell the php code to ignore the code that was calling for a database login. I tried deleting that part of the code but the php just won't work then. So by adding /* at the start of the code I wanted to be ignored and */ at the end worked like a dream. Hope this helps someone else.... Xilllly

     

    //  check if logged in

     

    /*

    if(!@$_SESSION["UserID"] || !CheckSecurity(@$_SESSION["_".$strTableName."_OwnerID"],"Add"))

    {

      $_SESSION["MyURL"]=$_SERVER["SCRIPT_NAME"]."?".$_SERVER["QUERY_STRING"];

      header("Location: login.php?message=expired");

      return;

    }

    */

  3. Rather than that, why don't I break my question down to its bare bones.

     

    What is the best way to use php to allow internet users to add data to a Mysql database table? Bearing in mind that the internet user shouldn't have to login or click on a guest button to do so. They just click a submit button after having filled in a form on a webpage and info is added to the database.

     

    Thanks...

  4. Hi,

    I've made a php webform which works fine. I've put that into my website so members can add their details to be become a member of my club. Again that works fine. Only issue is that when members get to the membership page (member_add.php) on my website, members are asked to login as a user. I use a Mysql database on a linux server.

     

    How do I set it up (correct php code to use) so members can add their details without having to login or be a guest, or setup a username, i.e. they just put in their details into the webform and it is added to the 'member' table automatically. No login required.

     

    Members only have access to member_add.php. After entering their details and pressing "Submit", members are sent to a thank you webpage. Only I have access to the full database.

     

    This automatic option is only needed for members to add data to the 'member' table as any other table and associated php page has a login for security reasons. Please note this question is in regard to a internet user, not a lan user.

     

    Also I need this to be a secure link to the Mysql database.

     

    Hopefully there is an answer to this? Thanks  :confused:

  5. 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

×
×
  • 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.