Jump to content

[Help]Register.php file


DarkVision

Recommended Posts

hi guys i need help i started a code of a page Register.php and i need to now what to do now and if this function is 100% ok with the php rules

<?php
// ----
session_start();
error_reporting(E_ALL);
include_once("...\\config.php")
//----------------------------------------------------
function getRegisteredBy($Reg);
{
    switch($Reg){
        case 0:
            return "AccountName";
        case 1:
            return "AccountPassword";
        case 2:
            return "AccountEmail";       
    }
}
$Reg = mssql_query("INSERT INTO MEMB_INFO (memb___id,memb__pwd,memb_mail,) VALUES ($AccountName,$AccountPassword,$AccountEmail)");
?>

thx for the help :) and have a good day

Link to comment
Share on other sites

still has an error please how to finish the code ?

function getRegisteredBy($Reg);
{
    switch($Reg){
        case 0:
            return "AccountName";
        case 1:
            return "AccountPassword";
        case 2:
            return "AccountEmail";       
    }
}
$Reg = mssql_query("INSERT INTO MEMB_INFO (memb___id,memb__pwd,memb_mail,) VALUES ($AccountName,$AccountPassword,$AccountEmail)");

Link to comment
Share on other sites

Then the problem is before the function() definition, not in it. The error is saying that php doesn't expect a function there, so something isn't closed properly before it. Could be a missing curly brace, or quote, or semicolon. Post the code that comes before the function also.

Link to comment
Share on other sites

is this 100% ok to do ?

function getRegisteredBy($Reg)
{
    switch($Reg){
        case 0:
            return "AccountName";
        case 1:
            return "AccountPassword";
        case 2:
            return "AccountEmail";       
    }
}
$Reg = mssql_query("INSERT INTO MEMB_INFO (memb___id,memb__pwd,memb_mail,) VALUES ($AccountName,$AccountPassword,$AccountEmail)");

Link to comment
Share on other sites

Since nobody here can tell just what it is you're trying to do with it, and its use isn't apparent from looking at the code, and you're evidently reluctant to provide more code, the best answer you'll get is the one you've already gotten: it is syntactically correct.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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