[Solved] Getting the result of a checkbox in php [closed]

if(isset($_POST[‘new’])){ } Will tell you if it was checked. If you want to be able to check the value as well you need to give the input a value. <input type=”checkbox” name=”new” value=”someval” style=”float:right” /> <?php if(isset($_POST[‘new’]) && $_POST[‘new’] == ‘someval’){ } solved Getting the result of a checkbox in php [closed]

[Solved] Unable to query two tables in mysql [closed]

You can make something like this: $postID = 1;//Post id we want to get from the database $getPost = $connection->query(“SELECT * FROM posts WHERE post_id=’$postID'”);//Get the post by the id $post = $getPost->fetch_assoc();//Fetch the result to an array $getUser = $connection->query(“SELECT username FROM users WHERE user_id=”.$post[‘id’]);//Get the username by using the id we got from … Read more

[Solved] Incrementing and resetting a PHP session variable

You write PHP in the middle of some JavaScript functions as if you expect it to be executed by the JavaScript itself. If you remove the HTML/JS output, you can see what actually happens on the server as soon as you load the page (I assume your code snippets are in order): session_start(); if (!isset($_SESSION[‘score’])) … Read more

[Solved] Wysiwyg for dynamic blocks of content? [closed]

YOu could use divs (styles to make them appear as 3 columns not provided): <div id=”wrapperDIV”> <div id=”col1″>column 1</div> <div id=”col2″>column 2</div> <div id=”col3″>column 3</div> </div> or what i prefer is tables: <table> <tr> <td>col 1</td> <td>col 2</td> <td>col 3</td> </tr> </table> you would create a wysiwyg editor into each column. There are tons of … Read more

[Solved] Fixed file name for upload.php script [closed]

Have you tried: <? $target_path = “uploads/”; $target_path = $target_path . ‘data.xml’; if(move_uploaded_file($_FILES[‘uploadedfile’][‘tmp_name’], $target_path)) { echo “The file “. basename( $_FILES[‘uploadedfile’][‘name’]). ” has been uploaded”; } else{ echo “There was an error uploading the file, please try again!”; } ?> 2 solved Fixed file name for upload.php script [closed]

[Solved] Change database value [closed]

you can use xmlhttprequest, and the javascript : var xhr = new XMLHttpRequest(); // Create new XHR var url=”http://sample.com/change.php”; // The url var data=”data=sample&back=come”; xhr.open(‘POST’, url, true); // POST is method you can with `POST|GET` xhr.send(data); or it can be simplifer with jquery var url=”http://sample.com/change.php”; // The url var data=”data=sample&back=come”; $.post(url,data,function(callback){ alert(callback); }); and sure … Read more

[Solved] Images not loading from folder [closed]

you need to use javascript and either preload all of the images, or use AJAX and call the image to be loaded. This is because all php is executed on the server (server side script) and needs refreshing before it is sent to the browser. use a client side script (javascript) to execute it in … Read more

[Solved] Write a function GeneratePassword which accepts two arguments, an integer and a character string consisting of letters (a-z) and digits (0-9) [closed]

Write a function GeneratePassword which accepts two arguments, an integer and a character string consisting of letters (a-z) and digits (0-9) [closed] solved Write a function GeneratePassword which accepts two arguments, an integer and a character string consisting of letters (a-z) and digits (0-9) [closed]

[Solved] Declaring objects and printing strings in PHP [closed]

This answer is from your first revision: https://stackoverflow.com/revisions/28522294/1 You have a few errors in your code: 1. Missing semicolon $this->hello_string = “Hello World!” //<- Missing semicolon at the end 2. Wrong access of class property’s echo “<font color=\”$this.font_colour\” size=\”$this.font_size\”>$this.hello_string</font>”; //… echo “<u><font color=\”$this.font_colour\” size=\”$this.font_size\”>$this.hello_string</font></u>”; I recommend you to concatenate the property’s with the string. How … Read more