Skip to content

Tag: php

PHPMailer GoDaddy Server SMTP Connection Refused

The other day I was experiencing some problems with my GoDaddy hosted site. I called their tech support, and the person that I spoke with suggested that my problems were related to the fact that I was on a Windows box and would be better served on a Linux box. Having no opinion on this, I agreed and they swit…

php-echo doesn’t stop after semicolon

this is a noob question.A very big noob question. I’m trying echo something,using notepad++ to code. But what I get is this: What am I doing wrong? Answer You are getting this result because you are running from Notepad++ Run -> Launch in Browser. This is wrong. Use any web server to make it work. It…

Codeigniter Rename file on upload

I’m trying to add time as the prefix of the image name along with the original name when uploading, But I couldn’t figure it out. Please help me with the following code to add a prefix to my original file name when uploading. Answer You can encrypt file name with use of CI native option: OR You ca…

php is not recognized as an internal or external command using xampp

I am using xampp, so my php folder is in C:xamppphp and I add in my PATH environment variables the C:xamppphp but when I am running on cmd the php command I am getting the following message: php is not recognized as an internal or external command. Any idea what I am missing? Answer When adding an entry to en…

Trying to use variable in MySQL INNER JOIN

I am a php and MySQL newbie. What I have done is created an html form with a <select> dropdown. Based on the selection from the form, it changes the $_SESSION[campaignID] variable. Changing the selection in the form is supposed to then change what displays on the page. The page consists of a forum style…

Modify microseconds of a PHP DateTime object

I have a PHP DateTime object with microseconds created as follows: How can I modify the microseconds value of $dt, without creating a completely new DateTime instance? Answer You can’t. There are three methods that can modify the value of a DateTime instance: add, sub and modify. We can rule out add and…