bahaa
-
Posts
147 -
Joined
-
Last visited
Posts posted by bahaa
-
-
Can any one tell me how to write the select statement using mysqli extension?
I know the insert and update ones but I don't know the select and delete ones.
Thanks in advance
-
Sounds good. Good luck with that.
Thank you
-
Semantically I suppose it really should use <fieldset> rather than <div> tags as (depending on your HTML declaration) won't validate. A fieldset works the same as a div except it's designed to group elements within a form.
Also if I were you I'd just customise the Wordpress admin pages rather than trying to re-create them.
Thanks for the advice.
I did not customize the admin pages because I am doing this for learning purposes. I like to create things from scratch so I know how things work.
I am going to school in next Sep majoring in Computer programming analyst, so learning such things would make it easier for me in my study.
-
everything is working fine now.
Thanks a lot for your help.
-
To be honest, I think you need to take a step back and rethink your form to begin with. I don't see any reason why you'd want to separate one form into two distinct-looking divs. I think it would only serve to confuse the user.
With that said, if you really wanted to do want you want to do, you'd create one form, and then put separate divs within that form. For example:
<form> <div> // Input items here. </div> <div> // Check boxes here. </div> </form>
That is syntactically correct and would work in HTML, but semantically speaking, it's a mess, and I would not encourage it.
Anyway, that's hopefully the answer you're looking for, but again, if you feel the need to do this, I'd rethink your design first and foremost.
Thank you.
I will try it.
I am just trying to make a CMS that look and work exactly as the word press CMS.
if you have an account with them, check the admin area and see what I am trying to achive.
-
Put it all together into one form?
I can't because I used them with 2 diff dives
one of the div on the left that display the categories
-
Hello,
I have a page with 2 forms in separate div tags.
the first form is for inserting the subject with the body to the database and the second form is for the list of categories with checkboxes.
What I want is to be able to insert the subject and check the category.
Any idea how to handle 2 forms for the same action?
Your help is appreciated.
-
category (id, name)
1 / Category 1
2 / Sub 2
3 / Category 3
three (id, parent*)
1 / 0
2 / 1
3 / 0
Result:
Category 1
---> Sub 2
Category 3
-------------------
Underlined: Primary key
Asterix: Foreign key
I did not quite understand this.
How about this
First table
Category
Cat_id Parent_id Item
Subcategory
ID Sub_id Item
the sub_id in subcategory is the parent id in category
-
Hello,
If you want to have categories and subcategories, what is the best approach to do that ? a table for the category and another one for the subcategory, or one table only?
-
Hello,
I will be developing news web site to practice what I have studied in the book.
As far as I know I have to consider the following features in the CMS:
1- Adding categories.
2- Users and every thing associated with that such as: editing, activation and permission.
3- News: adding, editing, deleting.
4- comments.
5 logs.
6- Site config.
Any other features I should take care of?
-
Thanks Josee
I understand it now.
-
Can any one explain to me what the $x and $y refer to in the sorting function ?
-
-
Thanks alot Antonio Conte
I really appreciate your help!
-
I would firstly ask are you sure you want to delete all the info. Would you prefer to make the user inactive, therefore keeping their details incase they come back? I'm not saying your wrong at all, just confirming your sure you want to delete all the user and comment details
Would you please tell me how to do it in both cases?
I am not working on a project. I only create tables and perform tasks on the form learning purposes.
-
Hello,
I have users table and comments table.
How can I delete a user from the users' table and at the same time get anything associated with this users in the comments table deleted automatically ?
-
I tries this and it worked.
is it good enough ?
$q = " select username, password, login_count, wait_login from users where username = '$username' and password = '$password' limit 1 ";
$r = mysql_query($q, $con);
confirm_query($r);
if(mysql_num_rows($r) == 1){
$row = mysql_fetch_array($r);
$wait_login = $row['wait_login'];
if($wait_login > time()){
echo " you are locked out for 15 minutes";
}else {
echo "You are logged in!";
$q = " UPDATE users set login_count = 0 where username = '$username' ";
$r = mysql_query($q, $con);
confirm_query($r);
}
} else {
echo "Incorrect password!";
$q = " UPDATE users set login_count = login_count +1 where username = '$username' ";
$r = mysql_query($q, $con);
confirm_query($r);
$q = " SELECT login_count, wait_login from users where username = '$username' ";
$r = mysql_query($q, $con);
confirm_query($r);
$row = mysql_fetch_array($r);
$login_count = $row['login_count'];
$login_wait =$row['wait_login'];
if($login_count>5){
echo " You are locked out for 15 Minute!";}
elseif($login_wait<=time()){
$q = " UPDATE users set wait_login ='$lockout' where username = '$username' ";
$r = mysql_query($q, $con);
confirm_query($r);
}
}
-
I have a little problem, which is one I update the wait_login NOW() plus 15, it resets if to zeroz.
-
Thanks guys
I will stick with the user's agent and session_regenerate_id() .
-
Add a wrong_logins column to whatever users table. For each wrong login, increase this by 1. Add a wait_logins column of type TIMESTAMP. When wrong_logins gets to 5, update this column to NOW() plus 15 minutes. When the user properly logs in, set wrong_logins to 0 and wait_logins to NULL. Add a check to the login process that wait_logins must be NULL.
That's the basic idea.
Thanks Larry.
I will try it and let you know>
-
Hello,
Can any one help me limit the login attempts?
for example: making the user wait 15 minutes after 5 unsuccessful login.
Thank in advance.
-
Oh, you meant you wanted to jump to an anchor on a page? I see. Well, if that's the case, then you probably need to completely restructure your URL. I thought you were clicking on a subject link, and then loading all the details of that subject onto a separate page.
Actually, bahaa, I'm confused now. If you get it working, then great, but if you have the time, could you please explain exactly what you want. Thanks.
Yes, I wantt to jump to a named anchor on the page
-
It sounds to me like bahaa is looking for how to add a named anchor to an URL containing a query string. The named anchor needs to go last. Something like:
echo '<a href="display_subjects.php?id=' . $row['id'] . '#namedAnchor">' . $row['subject_title'] . '</a>\n';
Yes, this is what I want.
I will try it, and let you know.
Thanks for your helps guys.
-
Depending on how far you want to take it, doing that might be difficult. If you'll notice, the URL is not composed of the standard script-name.php?name=value&name=value syntax.
I can't recall exactly (hoping for Larry to step in), but I believe he covers how to do this at the beginning of the second example site in his e-commerce book. Basically, you need to use an .htaccess file, etc. to convert the format of the URL.
I think it would be best to start out with the standard format used for the GET method, and once you have that working, then add this additional later on. In the end, the functionality is the same. The only difference is that the URL becomes slightly more "readable" for humans.
doing it with this "script-name.php?name=value&name=value syntax" fine .
Select Statement Using Mysqli Extension
in PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
Posted
I think I read in the book that we can write select statement mysqli extension so we don't use the mysqli_real_escape_string to escape values.
Not sure if I am write