Cron Job! Seems to be something wrong with my php
Hi Professionals I have been testing a php cron job and it is producing errors in the email response it sends to me, I have looked and looked and cannot see what seems to be wrong. Any ideas...
View ArticlePassing new value to object, within loop
Hello If we pass a value to a object when creating it with __construct $NewObject = new class($value) Lets say our object is placed within a loop to do some further stuff while(1 < 10) {...
View ArticleSQL Query inside IF/Else Statements
<?php $constructors = array ('Renault', 'Citroen', 'Ferrari', 'Fiat', 'Seat', 'Honda', 'Toyota', 'Hyundai'); for ($u=0; $u< count ($constructors); $u++) { if ($u % 2 == 0) { echo 'Pair...
View ArticleSql statement help
Hi, I'm working on a reset password for WordPress and I'm stumped on this query. What the query does is when a user requests a password reset, the query makes an update to the user's password and...
View ArticlePHP Like Help
Hello Guys, I have a system that generate project numbers. The system is: YEAR - PROJECT NUMBER . Sub ID 2014.1065.02 I want to be able to search my database for the sub ID's belonging to a...
View ArticleDelete multiple rows with PDO and checkboxes
<script> function setChecked(obj) { var check = document.getElementsByName("sel_ids[]"); for (var i=0; i<check.length; i++) { check[i].checked = obj.checked; } } </script> if...
View ArticleValidating a code from two diff tables column but same db
Hello Guys/Gurus Please I have an issue, am some months into php and i need your help/assistance. This is the flow. a client register at another site, when we confirm the registration, we send them a...
View ArticleShuffle() Issue
Hi in my code below, echo $body; outputs the link to every song in my $SongsFolder. How can I make it echo only one link and that link is the song the $Shuffle chose? I know I have array but is there a...
View ArticlePHP sending time sensitive, non-critical data to desktop computer
I'd like to send small bits of data from my web server to a desktop computer (Raspberry Pi) configured to listen to this data using Python. This data should be sent in real-time but the information...
View ArticleUniversal link
Whats wrong with this? Basically I'm trying to create a universal link for people logged into go to their profile named profile.php. I want the code to grab their id and then take them to their...
View ArticleForm Required Field
Hello, I obtained this code for a php form including a Captcha that I have modified. My question is, how do I make a field "not required", but if filled out, the entry will also be sent with the form?...
View ArticleSuggestions for best practices with arrays returned from MySQL queries
I have a set of tables for job listing. Right now I have a job table with id that is linked to multiple other tables that contain requirements for this job. For example: Job Responsiblities Job...
View ArticleInconsistent Times
My php script always returns different times. Example: The current time is 4:33pm and the script returns 11:33am. Then sometimes it is correct, and then randomly switches to something like 7:33pm...
View Articleaccess denied php
Hello, I am having a parculiar problem. whenever i try to add an user it gives me an access denied problem like this : Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]...
View ArticleSlight error, help?
Hey I was trying out PDO, and I got a minor error: Fatal error: Call to undefined method connection::prepare() on line 12 This is my connect.php class <?php class connection { private $user;...
View ArticleHelp improving code
Hey, I made the following code that checks the answers of a form: <?PHP include 'connect.php'; $points = 0; foreach($_POST as $id => $answer){ $result = mysql_query("SELECT id, ans FROM questions...
View Articleupload php form help
so i am trying to use a form to upload pdf documents to my server remotely. The php code is in its own file called "upload.php". The error I am getting is the die error "The file you attempted to...
View ArticleSaving multiples images problem
Hi guys Im trying to save multiples images with php, and I did it, but when I save the link on the Database, if I upload 3 images, its show 2 empty links with the raname name I had created, i would...
View ArticleIncluding date in file path
Hey all, Thanks for this great forum. I've learned a lot. What I'm trying to do is create a php script that will select a folder based on the date. For example, this is the original code: $file =...
View Article