I am creating a signup form for a website I am developing. I am using PHP to insert the form into my database. I have the useremail set as a Unique Key in my database. When I type in an email that already exists in my database it brings me to a blank page with this error message: Duplicate entry
How to make your own mailing services like gmail or yahoo
I am a noob to php and databases. But I have an idea to perform mail operations on my own web server (i.e just by database operations), but I really don’t have any idea of how to send mail to external …
PHP – Why am I being warned that my regular expression is too large?
I would like to use a regular expression to validate user input. I want to allow any combination of letters, numbers, spaces, commas, apostrophes, periods, exclamation marks, and question marks, but I also want to limit the input to 4000 characters. I have come up with the following regular expression to achi…
upload_max_filesize doesn’t change within Laravel 5.1
I’m working on multiple file upload while that time I’ve got an error The file “theOne.mp3” exceeds your upload_max_filesize ini directive (limit is 2048 KiB). So after that I’ve increased the …
Preg_match string inside curly braces tags
I’d like to grab a string between tags. My tags will be with curly braces. So far I have found #<s*?$tagnameb[^>]*>(.*?)</$tagnameb[^>]*>#s This one matches tags with angle brackets <>. I couldn’t figure out how to make it look for curly braces. Eventually I would like to p…
PHP uninclude or reinclude file in interactive mode
I’m testing some database related functions in interactive mode. The first thing I did is to include the testing file, let’s say database.php Then I can make change to the database by a function call. The question is, when I make any changes to database.php, I have exit PHP interactive mode, re-en…
Copy to clipboard from php command line script in Windows 7
I have a php (5.5) script which I run from the command line in Windows 7. Something like this: My question is, is it possible to copy something to windows clipboard from the script? I want users to have some text available in the clipboard after running this script from the command line. How can it be done? A…
How to display something only for the first item from the collection in Laravel Blade template
I have a @foreach loop in the Blade template and need to apply special formatting to the first item in the collection. How do I add a conditional to check if this is the first item? @foreach($items …
Outline a transparent image using imagick PHP
I have an image with a transparent background that I’d like to outline with a 5px border. In photoshop, I can stroke it to achieve this. I’ve tried using borderImage but it won’t outline the penguin. …
Can’t move composer
When I install composer on my mac with: curl -sS https://getcomposer.org/installer | php And then try to move it like this: sudo mv php composer.phar /usr/local/bin/composer it’s telling me: …