Skip to content

How I can create my own pow function using PHP?

I want to create a function in which I put two values (value and its power – Example function: multiply(3, 3) result 27). I have tried so far but failed, I have searched using Google but I have been unable to find any result because I don’t know the name of this function. What I want exactly: 3,3 …

When do I have to close mysqli (Database) connection?

For now, I have one connect.php file e.g. In every other PHP file that uses MySQL queries, I use “include ‘connect.php’;” For Instance on W3Schools, they create for every query a new connection and then close it after use. See here: w3schools.com: I’m not sure if they do it just …

PHP MVC not sending value to controller

I have been making a MVC site, I am having trouble sending the row id from my form to my controller. The code that I am using for my form gets the row ID for each db entry and assigns it to a hidden value. When the form is submitted it sends the parameters to the controller (should send $uid)

Get Instagram tagged user photos

How to get all Instagram tagged user photos? For example, I have user “user123”, and someone tagged me. How to get all images with @user123? https://api.instagram.com/v1/tags/@user123/media/recent?access_token=%%%&count=9 not working. Answer Currently there is no API to get all photos which ha…

How can I make an ad visible only to mobile users?

I want to use some mobile ads but my website has responsive design so I don’t use the m. subdomain. How can I make an ad visible only to mobile users? What about only to desktop or tablet? I’m using wordpress as a CMS. Thanks, Answer It’s quite easy using CSS3 Media Queries. In your CSS: For…

How to create a link to another PHP page

I just converted some of my HTML pages to PHP pages, and I’m not that familiar with PHP. In my HTML pages, assuming it’s just a static web app, I can link to another page quite simply by playing the following anchor on the page: <a href=”go-to-this-page.html”>This is a link</a…