Skip to content

Extract content with Xpath and data attribute

I need to extract the content of the following div tag which has the data-visible=”1″ attribute and contains the div id “line”. I tried it like that, but I dont get any result. What is the right way to extract the content with these both conditions and get the result: Answer Since this…

Otp is not post in database

after user submit mail id otp will be sent to that email id but my code isn’t working it post the email id in database but not the otp. Please can any one help? Controller Code auth.php Model code user_model.php Answer In your controller you are actually passing three arguments to the $this->user_mod…

How do I add a custom key to mysql information_schema.COLUMNS

Im using this mysql statement SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = ‘$dbck’ AND TABLE_NAME = ‘$tbck’ AND COLUMN_NAME = ‘$field_param’”. How can I add a custom key to the mysql information_schema.columns to look like this? Answer You can create and fi…

DRY and Typing Specialization

while I was learning PHP, I thought of a (simple?) problem that I could not solve “properly”. Here it is: I would like to create multiple “specialized containers” I would like to avoid duplicated code For example: So, I could then create “specialized” bag: I understood that…

Handling PHP URL and GET requests

I am currently parsing any given url, for example example.com/page/1 or example.com/api/info/1, by exploding the URL: and then accessing its elements in the array like so: But how could I handle (and access via array in the same way) a url that also includes GET elements, such as example.com/page?id=1 or exam…

change page HTML after change dropdown

I have 2 pages and the main page. the total 3 pages. I want to access the first and second pages after changing the dropdown list. I try this code by Jquery in my HTML called main.html. I want to use the if statement. If select 1 load firstPage.html If select 2 load secondtPage.html Any Edition of this code. …