Skip to content

Tag: php

Why should we separate PHP from HTML

I’m rather new to programming and i know how to separate PHP from HTML, but i would like to know if there is any difference in doing this: compared to doing this: Is there any difference between in performance etc, between splitting the PHP code from the HTML code and just echoing the whole page in php?…

How to set a collation with mysqli?

My database uses utf8_czech_ci collation and I want to set it to my database connection too. Mysqli_set_charset won’t let me set collation, if I don’t happen to want the default one, utf8_general_ci. Here was suggested first to set the charset through mysqli_set_charset and then to set collation b…

“Delete row” button for MySQL in PHP

I have a table that becomes populated with data from a MySQL database, and each row receives its own delete button. I would like to have the option to delete each row separately with a delete button that deletes the corresponding row in the database. How would I go about doing so? Here’s the part of the…

Selection option in php

I am working on a PHP quiz game and at the moment i am struggling a bit mixing php and html together as i have more previous experience in html. I have the following select option for quiz selection: I was told that this can be made with php code so that the new quizes are added onto it when

get the last redirected url in curl php

Hi I know its a very common topic on StackOverFlow. I have already spent my entire week to search it out. I have a url : abc.com/default.asp?strSearch=19875379 this further redirect to this url: abc.com/default.asp?catid={170D4F36-39F9-4C48-88EB-CFC8DDF1F531}&details_type=1&itemid={49F6A281-8735-4B74-…

How to call PHP a class from parent namespace?

I have the following namespace structure with the following class files So in App.php I’ve declared in Startp.php declared in Plugin.php declared I see that I can call the Plugin.php class from the App.php like if it’s a child/grandchild namespace, but what if I want to call Process.php from Plugi…

How to output mysqli_fetch_field_direct?

I’m trying to convert this code from mysql to mysqli. But when I print it and open in excel file I got an error. Catchable fatal error: Object of class stdClass could not be converted to string in C:xampplitehtdocsapptext2.php on line 139 Can someone Teach me how to convert this code in mysqli correctly…

Automatic Logout after 15 minutes of inactive in php

I want to destroy session if users are not doing any kind of activity on website. At that time after 5 users automatically redirect on index page. How is it possible? Is possible in php with session handling and for that I have to maintain or update user login time or not.. Answer This is relatively easy to a…