Skip to content

Tag: php

How can I get a PHP value from an HTML form?

I have an HTML form as follows: I want that the user of this form enters data in the input box. Then I would like this data to be the value of a PHP string – e.g. $username = “MY_NAME”; where MY_NAME is the value of the HTML form entered by the user. If the input by the user in

Get comments in a PHP file

I’ve been trying to get the comments out of a certain .php file on my server, in order to parse its variables. I thought Ii found an easy way to do this, however, the function I use doesn’t return anything, even though I clearly have comments in the file. Here are the comments I use: Here’s …

How to use the Google calendar API’s functions

I’m trying to use the Google calendar API and I can’t properly call the built-in functions. For reference: This code return a fatal error: Call to a member function getItems() on a non-object I don’t understand how to use an object which is not instantiated by a New(). Answer You need to add…

Get category tree recursively (Yii)

I have a table with following structure: categories id name parent_id I want to get the tree of categories with single function. I’ve written something like this in my model, but it doesn’t work. Can someone help me with this? Thanks. Answer I’ve finally solved the issue. If someone interest…

How can I get parameters from a URL string?

I have an HTML form field $_POST[“url”], having some URL strings as the value. Example values are: https://example.com/test/1234?email=xyz@test.com https://example.com/test/1234?basic=2&email=xyz2@test.com https://example.com/test/1234?email=xyz3@test.com https://example.com/test/1234?email=xy…