suzzane2020
-
Posts
233 -
Joined
-
Last visited
Never
Posts posted by suzzane2020
-
-
The checkboxes are generated in a loop rite?
as in a checkbox for each subject?
-
what do u mean 'by every record ' is it an addr to a new page?
-
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
-
i gues u cud avoid te confusion this way:
y not add the id of the user table with each of the usrnames
ie
jbloggs_1
jbloggs_2
this way the username wud always be unique
-
No you cant do it directly from 'Action' but can write the query on the form submit event
-
if u have some other fields to be added along with the image,
insert that first
select the records again
get the last id and update the image along with the last id
-
a good solid practical exp of 1 to 2 yrs wud be good before attemptin for the certification
-
is there a row with category_id 4
remove the quotes this time
not required fro a numeric value
-
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
-
wud be grt if u cud respond
-
try doin it this way
$num=mysql_num_rows($result)
if($num!=0)
{
}
else{
}
-
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
-
for the table part it shud be the same table u insert the values at first
and for the link
try it in other emails too
like gmail,yahoo
usually yahoo has a probs in showin links ori guess it gmail..
im nt sure
had come across this same prob before
-
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
-
and the tblname wud be the actual name of ur table in te databse where u have the username and passwords stored
-
The query shud be in quotes
$res=mysql_query("update tblname set enabled='yes' where login='$login' ");
-
if(isset($_GET["password"])) { $login=$_GET["login"]; $password=$_GET["password"]; $enabled=$_GET["enabled"]; }
use just this.dnt have to repeat
u can use "login" or enabled" instead of password.
any one of the parameter names passed
-
okie seems u have not gt the concept rite yet. no p-robs.
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
-
<?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"];
-
yes u neeed to
and which is line 3?
-
echo " <div align='right' ";
havent closed the div tag
-
$message="<a href='www.runnerselite.com/reg_success.inc.php?user=".$username."&pwd=".$pwd."&enabled=yes'>Please click to confirm</a>";
try this
-
You mite have the same error repeatin
cud u tell us any one of the errors?
-
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
Totally Stuck with Query!
in PHP Coding Help
Posted
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>