[Solved] PHP sql database not updating after update query, indexes are not defined? [closed]

At first you have to change: <input type=”date” id=”updateltext” name=”listdate” value=””/> to: <input type=”date” id=”updateltext” name=”list_date” value=””/> To match what you have in your php code and apply it to the rest of the html inputs then change: WHERE product_id = ‘ .$id. ‘ to: WHERE product_id = ‘$id’ Notice Don’t forget to format for=”” … Read more

[Solved] php radio buttons submit form issue

You have to add attribute , ” required ” to all the input fields so that an error message will be displayed when one is empty!! To check if the answer is correct, you can use php! $name=$_GET[“name”]; $email=$_GET[“email”]; $ans=$_GET[“ans”]; if($ans==’correct’){ // you can use mail command here header(“location:correct.php”); }else{ header(“location:incorrect.php”); } solved php radio … Read more

[Solved] A colon after foreach loop statement cause an error

<?php foreach($resultsb as $optionb) : ?> … <?php endforeach; ?> is nothing else then: <?php foreach($resultsb as $optionb) { ?> … <?php } ?> IMO it enhances the readability in files with a lot of html/xml etc. 2 solved A colon after foreach loop statement cause an error

[Solved] Php function doesn’t run [closed]

$book=mysql_real_escape_string($_POST[‘books’]); $sql=”INSERT INTO books (bID, book) VALUES (”,’$book’)”; if (!mysql_query($sql,$con)) { die(‘Error: ‘ . mysql_error($con)); }` <— Here is a rogue quote.. The syntax highlighter if StackOverflow spotted this problem. Do you use an editor with a highlighter too? Since the code is now invalid, PHP cannot parse the file and will fail. It doesn’t … Read more

[Solved] Html button who can load/fire multiple JS/button in each div

Determine a way to identify the button. For example, if your page looks like this: <header> … </header> <section id=”songs”> <button>…</button> <button>…</button> <button>…</button> </section> … then you could get a list of buttons with: var buttons = document.getElementById(“songs”).getElementsByTagName(“button”); Then loop through the buttons, and call button.click(). 1 solved Html button who can load/fire multiple JS/button … Read more

[Solved] Facebook profile page regex excluding dialog|plugins|like pages [closed]

Try this: it matches anything before and after “facebook.com” followed optional by “https://stackoverflow.com/” and not followed by “plugin”, “dialog”, “like” (.*)facebook\.com\/?(?!plugins)(?!dialog)(?!like)(.*) See this online example code (?!text) is positive lookahead regexp. You can read more about this here. 1 solved Facebook profile page regex excluding dialog|plugins|like pages [closed]

[Solved] PHP arrays, getting to loop index information

I’m making an assumption about the true layout of your array, the following will create a $weekDays array to map an integer and a day of the week (I define the keys so you can shift them at any time): $weekDays = (1=>’Monday’, 2=>’Tuesday’, 3=>’Wednesday’, 4=>’Thursday’, 5=>’Friday’, 6=>’Saturday’, 7=>’Sunday’); // loop through each week-day in … Read more

[Solved] Get current time and date using PHP [duplicate]

There is no way for php (server side) to know the client’s time zone. This information is available to client side technologies like javascript. This could help you: https://bitbucket.org/pellepim/jstimezonedetect It will store the client’s time and timezone in a cookie which is then accessible through php. solved Get current time and date using PHP [duplicate]