-
Posts
56 -
Joined
-
Last visited
Never
Posts posted by pwes24
-
-
Thanks everyone! Much love
-
This is a small issue I believe, but I just can't get it right. Please help.
I'm like to store login info for new users. This script should check user input and if empty, should return error msg and not save anything on the database table. But my code saves whatever is sent even if some sections are empty. What should I do?
if ($name == "") { $error .= "Enter your name"; } if ($username == "") { $error .= "Enter username"; } if($password == "") { $error .= "Enter password"; } else { $query = "insert into 'login' values()";
I have shortened to get to the point. If I only use one 'if' and one 'else' statement it works well. What can I do?
-
Thanks alot!
-
Hello everyone,
I have two issues regarding dates:
1. How can i capture a formatted instance of a particular date like now in a variable to store on a database table;
2. How do i calculate between two dates and come up with the days, hours and minutes between them?
Thank yall!
-
Hello everyone,
I'd like to redirect a page after afew seconds of logging out. I have an idea but not sure. Someone help me. The code in mind is:
redirect(url, seconds);
Is this correct?
-
Hello everyone,
I'd like to sort a table(descending) after fetching it. What expressions should I use. Also if you know where I can read more on this and other related topics, please let me know. Thank you.
-
Thank you so much guys/ladies.
-
Thank you for the reply. where do i get the directory? is it in the configuration?
-
Hello everyone,
What can I do to make sure that the index file for my website is first displayed when people visit my website? For some reason, it is not.
Thank you
-
Can you give a generic example? How do I prevent it from reloading?
-
Hello everyone,
Is there a way I can play the same song over different web pages on my website without the song loading on every new page I'm visiting?
I don't know where to ask this question, so I'll try here.
Thank you.
-
Thank you soo much!
-
Hello and happy new year!
When fetching items from a database table to display on a web page, how can I set it so I get a set number of items to display on each page, say 10 rows, for each page till there are no more?
Thank you in advance.
-
Thanks guys, that helps alot.
-
I can query and display using mysql, but its comes out one row after another going down. How can I display like three rows deside each other, like diplaying clothes?
-
Hello everyone,
I have two questions:
1. How can I add up the products in a shoppingcart and display the total;
2. How can I display products side by side as opposed to one after the other vertically?
Thank you!
-
Hi everyone. I have script to logout a user but I've realized that if after logging out a user can go back in the same browser and view restricted files. This script works only if the user closses the browser window. Any ideas?
<?php session_start(); if (isset($_SESSION['user_id'])) { echo "Your username is ".$_SESSION['user_id'].".<br>"; session_destroy(); echo "Your username is still ".$_SESSION['user_id'].".<br>"; $_SESSION = array(); echo "You are now logged out!"; } ?>
-
I'm working on login page. How do I correct "session alredy sent" and "Cannot modify header information"?
Please help. Thanks
-
i'd like to learn how email login info to a new user using php code. Something short .
Thanks!
-
What do mean the form field? Can you explain more please?
Thank you.
-
Hello everyone.
Say you have two forms on a page that gather different information. How do i make sure that script working on a particular form is called when the other form is submitted? Do I use,
if($_POST['submit']) { ?
and does the 'submit' stand for the name of the submit button?
Thanks for reading this post.
-
$days is a variable that holds the values of a checkbox accessed through $_GET['days'];
'days' is an array of values that have been checked by user in a checkbox set.
-
What am I doing wrong here?
<body>
<?php
if (isset($_POST['submit'])){
$food=$_GET[food];
if (!empty($food)) {
echo "The foods selected are:<br />";
foreach($food as $foodstuff) {
echo $foodstuff.", ";
} else {
echo('check a box please');
}
}
}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<fieldset>
<label>Italian <input name="food[]" type="checkbox" value="Italian" checked /></label>
<label>Mexican <input name="food[]" type="checkbox" value="Mexican" /></label>
<label>Chenese <input name="food[]" type="checkbox" value="Chenese" /></label>
</fieldset>
<input type="submit" value="submit" name="submit">
</body>
-
Well the script is pretty long but heres a picture:
a user needs to state what days he's available to work. Let's say he is available Friday and Monday. The table handlin user info has one spot to store these days. so first i capture user selection as $days=$_get['days'] and insert into `table` as $days. when i check user input in the table, it shows "array". Can i have something like Friday, Monday?
setting interval
in PHP Coding Help
Posted
Hello everyone,
I'd like to set an interval for a fuction to execute after x minutes. Anybody know how to write it?
Thanks in advance!