Jump to content

suzzane2020

Members
  • Posts

    233
  • Joined

  • Last visited

    Never

Posts posted by suzzane2020

  1. ok wat i meant is

    u wud have a table for subjects and a query to get them in the form

    <form name="">

    <table>

    $res=mysql_query("select * from subject_tbl");

    while($row=mysql_fetch_array($res))

    {

    ?>

     

    <tr>

    <td><input type="checkbox" name="links" value="<?php echo $subject_name?>"></td><td><?php echo $subject_name;?></td>

    </tr>

    <?php }?>

    </table>

    <input type="hidden" name="chkIds">

    </form>

     

     

  2. ur gonna need javascript for this

     

     

    <script language="JavaScript" type="text/javascript">
           function MM_callJS()
                { 
                                    
    	document.form1.chkIds.value=document.form1.links.value
    	for (i=0; i<document.form1.links.length; i++)
                           {
    		 if (document.form1.links[i].checked==true)
    			{
    
    				document.form1.chkIds.value=document.form1.chkIds.value+","+document.form1.links[i].value
    
    					}   
    					  }
    					         
    		return true;		
    		  }
    </script>
    

     

     

    now here u wud need a hidden field which is "chkIds" here and the name of the checkbox wud be "links"

    as the checkbox is in the loop, the javascript takes the length or number of checkboxes generated-" document.form1.links.length" and gets the value of each selected box-"  if (document.form1.links.checked==true)"

     

    then its passes it to the hidden field- "  document.form1.chkIds.value=document.form1.chkIds.value+","+document.form1.links.value"

     

    with a separator '+' in between

     

    let me knw if u gt this till here

  3. not this way

    // see if any rows were returned
    if ($num=mysql_num_rows($result) > 0)

     

    change it to

     

    $num=mysql_num_rows($result);

    if($num!=0)

    {

    }

     

    SELECT * FROM Products WHERE Category_id = '4'"

    copy this and paset it in the database n see if u get the record

     

    if not try it without the quotes

  4. ok cool we have reached till here

    if(isset($_GET["login"]))
    {
    $login=$_GET["login"];
    $password=$_GET["password"];
    $enabled=$_GET["enabled"];
    }

     

    we can take out the password from here since its nt sent thru the link

     

    so it becomes

    if(isset($_GET["login"]))
    {
    $login=$_GET["login"];
    $enabled=$_GET["enabled"];
    }

     

    after this once the user comes to this page

    try echoin all the values to see if we got them

    echo $login;

    if yes then check the table to see if the login name has been entered initially

     

     

     

  5. its fine if u dnt have the password or infact better since it is confidential.

    we can leave out the password since the username is anyways unique and we wud be using tht to update our query

     

    so no probs just remove the password bit from the link an d proceed

     

    and also

    since we are nt usin the password

    rem0ve it from

    the reg_success page

  6. okie  seems u have not gt the concept rite yet. no p-robs. :P

    heres hw

     

    when u use

    if(isset($_GET["username"]))

    the "username" or watever it is thts there inside the brackets shud be one of the parameters u sent

    ie

    in the link

    <a href='www.runnerselite.com/include/reg_success.inc.php?login=".$login."&password=".$password."&enabled=yes'>Please click to confirm</a>";

     

    u have

    login=".$login."&password=".$password."&enabled=yes'

     

    so the values u can use to check in the bracket are either "login","password" or "enabled"

    ie the names that u assign for the parameters.

    so we are checkin if any one of these parameters are sent thru GET method

    so the code shud be

    if(isset($_GET["login"])) or password or enabled

     

  7. <?php if(isset($_GET["username"]))
    {
    $username=$_GET[];
    $pwd=$_GET[];
    $enabled=$_GET[];
    
    $res=mysql_query(update tblname set enabled='yes' where username='$username')
    }
    ?>

     

    hey u need to have the parameter names in the brackets.

    ie if u have passed the username in the link this way

    &user=$username

     

    it shud be

    $user=$_GET["user"];

  8. k in te second page

    u need to get the parameters using GET

    if(isset($_GET["username"]))

    {

    $username=$)GET[];

    $pwd=$_GET[];

    $status=$_GET[];

     

    $res=mysql_query(update tblname set status='true' where username='$username')

    }

     

    n thts it

    after this you can give any message to the user such as "Thank You for reg...etc etc

     

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