-
Replied To a Post in Want to create delete action for CMS posts
[Click Here](http://8pic.ir/images/3dx6zswxa95tacbax1hm.png) -
Replied To a Post in Want to create delete action for CMS posts
So it must be this: [Click Here](http://8pic.ir/images/2b976kffimx3qcx50htf.png) -
Replied To a Post in Want to create delete action for CMS posts
So it must be this: [Click Here](http://8pic.ir/images/2b976kffimx3qcx50htf.png) -
Replied To a Post in Want to create delete action for CMS posts
> Or you refer what I shown? Where did you show me? My request url was http://www.my_domain_name/cms/admin.php Is it ok or needed to get screenshot to show? I still didn't … -
Replied To a Post in can't echo data from db in seprate lines(using textarea to type data)
I know! i changed exactly those 2 parts you are pointing at them, but it didn't solve the problem. I changed them correctly but they didn't work well. I soved … -
Replied To a Post in Want to create delete action for CMS posts
Well F12->network, after that i clicked the button and 2 rows appears, the type of first row was html and for the second row was js. On the right column … -
Marked Solved Status for can't echo data from db in seprate lines(using textarea to type data)
Hi. In my CMS, when i type a content for a new post in the textarea, like this: one two three four five six and then click the submit button, … -
Replied To a Post in can't echo data from db in seprate lines(using textarea to type data)
Thank you @lps, it works ok now with using `Content: <textarea name="content" rows="10" cols="40"><?php echo str_replace("<br />","",$row['Content']); ?></textarea>` I think you have edited your last post. > $data = ereg_replace("(\r\n|\n|\r)", … -
Replied To a Post in Want to create delete action for CMS posts
I deleted that html part from delete-action.php file, but still when i click delete button, the message "Success" appears above the html table but the html table won't update itself. -
Replied To a Post in Want to create delete action for CMS posts
When i click delete button, the Success message appears above the html table but the html table doesn't update itself, i have to refresh the page to check the html … -
Replied To a Post in can't echo data from db in seprate lines(using textarea to type data)
This is what i typed in the textarea for a new post and inserting into db with `$content = nl2br(htmlentities($_POST['content']));` : hi hi hi Then i checked db table and … -
Replied To a Post in Want to create delete action for CMS posts
Thank you @lps for explanation. You forgot to answer my question about updating the page and html table at the time of clicking the Delete button. -
Replied To a Post in can't echo data from db in seprate lines(using textarea to type data)
@lps, with using `$content = nl2br(htmlentities($_POST['content']));` in my script, i can type a text in the textarea and use ENTER key for line breaking. Then when i send the content … -
Replied To a Post in problem with db table id
Well, it doesn't work, because in every page we will have 3 posts and with using `$index = 1;` and `$index++;` we will have posts with id number 1 to … -
Replied To a Post in can't echo data from db in seprate lines(using textarea to type data)
I read [here](http://php.net/manual/en/function.nl2br.php) and [here](http://twig.sensiolabs.org/doc/filters/nl2br.html), but would you please give me a simple example of how to use it in a text? Like what we see in the second link … -
Marked Solved Status for Can i leave the try block open in a php file? or can forget to use it?
Hello. Please look at this: <?php $servername = "localhost"; $dbname = "mydbname"; $dbusername = "mydbusername"; $dbpassword = "mydbpassword"; try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $dbusername, $dbpassword); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $id=$_GET['id']; $sql … -
Replied To a Post in Can i leave the try block open in a php file? or can forget to use it?
Oh! i'm sorry i found the problem. I forgot to change this part: $servername = "localhost"; $dbname = "mydbname"; $dbusername = "mydbusername"; $dbpassword = "mydbpassword"; -
Replied To a Post in Can i leave the try block open in a php file? or can forget to use it?
@lps i used that way but faced mhith some errors. -
Revoked Solved Status for Can i leave the try block open in a php file? or can forget to use it?
Hello. Please look at this: <?php $servername = "localhost"; $dbname = "mydbname"; $dbusername = "mydbusername"; $dbpassword = "mydbpassword"; try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $dbusername, $dbpassword); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $id=$_GET['id']; $sql … -
Created can't echo data from db in seprate lines(using textarea to type data)
Hi. In my CMS, when i type a content for a new post in the textarea, like this: one two three four five six and then click the submit button, … -
Began Watching can't echo data from db in seprate lines(using textarea to type data)
Hi. In my CMS, when i type a content for a new post in the textarea, like this: one two three four five six and then click the submit button, … -
Created problem with db table id
Hello everybody! There is a problem with my db table. For example i send 6 posts (with title, author and content) to the db table one after an other, so … -
Began Watching problem with db table id
Hello everybody! There is a problem with my db table. For example i send 6 posts (with title, author and content) to the db table one after an other, so … -
Marked Solved Status for Looking for a good tutorial for creating chat messenger in Java
Hello. I'm looking for a good tutorial for creating a chat messenger in java. I checked [this link](http://www.javaworld.com/article/2076864/java-concurrency/building-an-internet-chat-system.html?page=1) but it was not good and clear, was poor tutorial without clear … -
Replied To a Post in Looking for a good tutorial for creating chat messenger in Java
This is very sad.... for now just want to learn Java. Thank you for your answers. -
Replied To a Post in Want to create delete action for CMS posts
Yesss :) It works! Thank you @lps. I used the ajax part, the php loop for the html layout and the delete-action.php. I have some questions. First, i thought with … -
Marked Solved Status for problem with putting variable sending with submit button into LIMIT part
hello me again:) There is a page in my cms that users can see my posts there and i want to limit the number of posts that must be shown … -
Replied To a Post in problem with putting variable sending with submit button into LIMIT part
Yes it work ok now. Thank you @cereal for clear explanation and for updating my code:) I understood it well. -
Marked Solved Status for Can i leave the try block open in a php file? or can forget to use it?
Hello. Please look at this: <?php $servername = "localhost"; $dbname = "mydbname"; $dbusername = "mydbusername"; $dbpassword = "mydbpassword"; try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $dbusername, $dbpassword); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $id=$_GET['id']; $sql … -
Replied To a Post in Can i leave the try block open in a php file? or can forget to use it?
Thank you @lps. I understood. I will do what you recommend to me. -
Marked Solved Status for security problem with login into admin page by typing the link in browser
Hello. i'm creating a simple CMS for myself. There is a register form, i can register as the admin of the cms and then with login form, i can enter … -
Replied To a Post in security problem with login into admin page by typing the link in browser
Thank you @AleMonteiro, and tahnk you @JorgeM for your guidance. And for everyone that may have the same problem as what i had; [this link](http://html.net/tutorials/php/lesson12.php) is a very clear and … -
Edited Can i leave the try block open in a php file? or can forget to use it?
Hello. Please look at this: <?php $servername = "localhost"; $dbname = "mydbname"; $dbusername = "mydbusername"; $dbpassword = "mydbpassword"; try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $dbusername, $dbpassword); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $id=$_GET['id']; $sql … -
Created Can i leave the try block open in a php file? or can forget to use it?
Hello. Please look at this: <?php $servername = "localhost"; $dbname = "mydbname"; $dbusername = "mydbusername"; $dbpassword = "mydbpassword"; try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $dbusername, $dbpassword); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $id=$_GET['id']; $sql … -
Began Watching Can i leave the try block open in a php file? or can forget to use it?
Hello. Please look at this: <?php $servername = "localhost"; $dbname = "mydbname"; $dbusername = "mydbusername"; $dbpassword = "mydbpassword"; try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $dbusername, $dbpassword); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $id=$_GET['id']; $sql … -
Replied To a Post in Want to create delete action for CMS posts
My last code changes is: <?php $servername = "localhost"; $dbname = "mydbname"; $dbusername = "mydbusername"; $dbpassword = "mydbpassword"; try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $dbusername, $dbpassword); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = … -
Replied To a Post in Want to create delete action for CMS posts
This is my last update, i tried to use the script of [this link](http://www.formget.com/delete-using-php/), (look at PHP File: deletephp.php there), but it didn't work for me. Mine: <?php $servername = … -
Replied To a Post in Want to create delete action for CMS posts
Nobody can help me with this problem?! No more suggestion? I have sent my last update that still doesn't work. -
Replied To a Post in problem with putting variable sending with submit button into LIMIT part
Thank you @cereal for clear explanation. Well, i have deleted that file unfortunatelly. Now this is my last update for now: (ofcourse i have not changed the design of the … -
Replied To a Post in Want to create delete action for CMS posts
This is my last code changes: <?php $servername = "localhost"; $dbname = "mydbname"; $dbusername = "mydbusername"; $dbpassword = "mydbpassword"; try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $dbusername, $dbpassword); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql … -
Replied To a Post in problem with putting variable sending with submit button into LIMIT part
Why you set `$error = FALSE;` and `$result = FALSE;` to False? You changed this part: } catch(PDOException $e) { echo $sql . "<br>" . $e->getMessage(); } to this: } … -
Replied To a Post in problem with putting variable sending with submit button into LIMIT part
Yesss :) it work nice thank you again @cereal! But what was the problem in my code that it didn't work? I compared your last code with the last one … -
Replied To a Post in problem with putting variable sending with submit button into LIMIT part
Thank you @cereal, were good and very clear explanations. I changed the code. There is still a problem. Now the only page i can see is page one with posts … -
Replied To a Post in Want to create delete action for CMS posts
@Eagle.Avik, so you means i should use this? The way i used was incorrect? $conn = new PDO("mysql:host=".$servername.";dbname=".$dbname, $dbusername, $dbpassword > as +lps mentioned, you should use ajax to call … -
Replied To a Post in problem with putting variable sending with submit button into LIMIT part
Would you please explain this line for me? //What does floor do here? $pages = floor($posts / $perpage); # get current page, define 1 as default value // What does … -
Replied To a Post in problem with putting variable sending with submit button into LIMIT part
I think the problem must be in these lines: here: $range = $perpage * $number; here: $stmt = $conn->prepare("SELECT ID, Title, Author, Content FROM Posts LIMIT :limit, :perpage"); And here: … -
Replied To a Post in Want to create delete action for CMS posts
Any more suggestion for how to edit this code to work? Every guidance is welcome. -
Replied To a Post in problem with putting variable sending with submit button into LIMIT part
Thank you @cereal for your clear explanation and for the links. Yes it works fine, thank you again. But there is a little problem i tried to fix but i … -
Replied To a Post in problem with putting variable sending with submit button into LIMIT part
I want each page to show only 3 posts to the user, so posts 1-2-3 go into page 1, and posts 4-5-6 go into page 2, and posts 7-8-9 go … -
Replied To a Post in problem with putting variable sending with submit button into LIMIT part
Yes it works, thank you @cereal. Would you please explain these lines for me? //What does trim exactly do? $number = trim($_POST['number']); //What does this line say? $number = filter_var($number, …
The End.