39,316 Topics
| |
Hello, how can I improve this form login with error alerts? For example, if the fields are empty, if entered data do not match any user, etc. etc. Right now my form is so, taking advantage of a class: if(isset($_POST['login'])){ //Retrieve the field values from our login form. $username = … | |
Hey everyone, I am trying to be able to have a textbox that only accepts numbers that is either 1 or greater but less than the number of items in a table from the databse. The queries work fine and such. What I'm trying to figure out is how to … | |
I have been wrestling with this subject for six months and can find no complete answer anywhere on the web or in any book seen. I have become very familiar with the debate and so it is not necessary to debate the following here. I had rather do all of … | |
Hello there, I need a simple function which do something like tihs: I have folders like this: ext/test1/test1/index.html ext/test2/ ext/test1/test2/index.html ext/test3/ I need a function which gives me only folders with subfolders and files in it. The condition is to give a "ext/" folder in the function :) function get_subdirs('ext/') … | |
This question is very similira to this [one](https://www.daniweb.com/programming/web-development/threads/472324/inserting-a-multidimensional-array-into-db) but with a little twist to it. I have an array that looks like this: Array ( [0] => Array ( [post_id] => 5410 [Issue] => 2010 [_Issue] => field_573d7fa8454e9 [_volume] => field_573d7f79ef9ab [volume] => 530 [_journals] => field_56d3de5ddc04d [pages] => 105-9 … | |
This question is similar to this [one](https://www.daniweb.com/programming/web-development/threads/371092/notice-undefined-index-id-on-line-26) However, my insert does not involve a form but a direct mysql query that looks like this $query2 = "insert into table(author,title,abstract) values(:author,:title,:abstract) "; $stm=$con->prepare($query2); $stm->bindValue(':author', $author, PDO::PARAM_STR); $stm->bindValue(':title', $title, PDO::PARAM_STR); $stm->bindValue(':abstract', $abstract, PDO::PARAM_STR); $stm->execute(); echo "$author   $title   $abstract <br>" In … | |
I want to insert multiple records to wp_posts table in word press using a mysql query and not the front-end. I also want these new records(that i insert into wp_posts) to insert metadata into wp_postmeta table. My question is how can i do this? How does wp_posts update wp_postmeta if … | |
SELECT blabla FROM a INNER JOIN b ON a.a = b.b Is what I have. However I'd like to sort the results DESC by ID. I'd like to select last [`variable` x 10] of items sorted by ID DESC. Variable provided by PHP (I'll sort things out, I just need … | |
`Unknown column 'topics.id' in 'field list'` `SELECT topics.id topicId,` [...] `topics.id` DOES exist. | |
What is the difference between following functions? Does these both functions perform same task? $wh_ope=clean($_POST['whop'])?(int)$_POST['whop'] : 0; $wh_ope=(int)clean($_POST['whop']); function clean($str) { $cstr=trim($str); $cstr=addslashes($str); $cstr=strip_tags($str); $cstr=htmlspecialchars($str); return $cstr; } | |
I don't think it's code-bound, but here's the code: http://pastebin.com/yWJ5qpwN What happens is... I input 2 different passwords, line 22 is for some reason entirely skipped. The script passes every verification, the SQL record is added, and further execution of code happens. User gets logged in and moved to `index.php` … | |
i have a problem in showing two columns which is reff_number and Name in a combobox/select box, and now i can only display one column with it, if i have 9000 customer(in bahasa = pelanggan) , it will take an effort to find for user, and it will be easy … | |
Hi, I need help with the attendance form (index.php). When I tried to update the first row, nothing happened. For the last row, the message says, "**We couldn't update the attendance form at this time.**" Please check lines 96 and 101 to see if got any error. And also I … | |
I have purchased SMS gateway from one hosting company. How can i integrate my SMS gateway with my website? | |
I need to create about 1000 users, with random (but normal looking names not "293dsaf81s234" but "Blue Air" (can be random dictionary words)). And I need to generate topics and posts, and many others things. Does anybody know a good way on how to generate dummy content in PHP? What … | |
How I replace my eregi_replace with preg_replace expression? eregi_replace($word, '<font style="background:' . $color . '";>\\0</font>', $text); and I how do I check preg_replace function is executed or not? | |
Hi, i have was make small social network website and now i need to use RESTful API for hybrid application. Social network website i make in php, mysql. How to make API now? Do you have some tutorial for API that integrate in existing website? Thanks! | |
Hey everyone, I have a question about prepared statements for PHP and mySQL. I have been able to do them for a single row such as ID and such for a particular object, but is it possible to do a SELECT all command as well? I want to be able … | |
I have a member table from which I'm trying to create a query using these fields mem_id / username / create_date / mem_status / ref_id / qualify_id A new member is mem_status 'F' with ref_id equal to the mem_id of their referrer and qualify_id of zero When the member upgrades, … | |
I've created a new member for a website (that I'm making for myself) to see if it works and when I register, I can get in, but when I go to log in after, it won't let me log in and I can re-create the same member multiple times. The … | |
Hey everyone, I have created a PHP web application that allows people of different permissions to do certain things such as read-only, add, update, or delete. That works pefectly. However, it came across my mind that I have not done anything to prevent against SQL injection or XSS attacks. I … | |
I have below code for getting the sundays. any body me to get saturdays $start = new DateTime('2013-01-06'); $end = new DateTime('2013-01-20'); $days = $start->diff($end, true)->days; $sundays = intval($days / 7) + ($start->format('N') + $days % 7 >= 7); echo $sundays; | |
I have two dates like $date1 ="2016-05-01"; $date2 ="2016-05-31"; how to get saturday and sunday count like between range is 9 | |
Below is my code function getWorkingDays($startDate, $endDate){ $begin=strtotime($startDate); $end=strtotime($endDate); if($begin>$end){ echo "startdate is in the future! <br />"; return 0; }else{ $no_days=0; $weekends=0; while($begin<=$end){ $no_days++; $what_day=date("N",$begin); if($what_day>5) { $weekends++; }; $begin+=86400; }; $working_days=$no_days-$weekends; return $working_days; } } $beginday=date("2016-04-01"); $lastday=date("2016-06-30"); $nr_work_days = getWorkingDays($beginday,$lastday); echo $nr_work_days; ?> above code is giving count … | |
$city = "Amersfoort"; if ($stmt = $mysqli->prepare("SELECT District FROM City WHERE Name=?")) { $stmt->bind_param("s", $city); $stmt->execute(); $stmt->bind_result($district); $stmt->fetch(); printf("%s is in district %s\n", $city, $district); $stmt->close(); } This brings many questions: - What is `s` on the line 4? Do I need to bother with that? - What if I … | |
hi, all i am new in php developing i need to know how i could make a user data hidden or inactive to the viewer of my website without deleting this user data from my database can i do that using php code? if yes what is this coding criteria … | |
Hello guys. I am currently developing a Case Management System with a versioning function. The versioning function will allow top management to see the different versions of a document and the different changes that were made by either the lawyer or top management. My problem is, how would I start … | |
Hi, In an excel file, I have 10 headings and that file contains more than 6000 records. I upload file using oleread.inc and excelreader file. It takes time to upload recods in table minimum 4 - 6 minutes. How to decrease the time and insert records in table fastly. | |
I'm getting two errors detailed below: Notice: Undefined index: username in C:\wamp\www\member.php on line 8 Call Stack # Time Memory Function Location 1 0.0006 131808 {main}( ) ...\member.php:0 ( ! ) Notice: Undefined index: passwd in C:\wamp\www\member.php on line 9 Call Stack # Time Memory Function Location 1 0.0006 131808 … | |
I have this code session_start(); $username = $_SESSION['username']; function getUserRole($username, $roleid){ $con=dbConnect(); $query="select * from user inner join userrole on user.id = userrole.userid inner join role on role.id = userrole.roleid where username = $username"; $sql=$con->prepare($query); $sql->bindValue(':username',$username); $sql->bindValue(':roleid',$roleid); $sql->execute(); $row = $sql->fetch(); $username = $row['username']; $roleid = $row['roleid']; if($row > 0){ … |
The End.