Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Not adding images to database not creating pages

Posted on 2014-12-04
9
Medium Priority
?
105 Views
Last Modified: 2014-12-09
Im having a problem with my small control panel where you add images to mysql then it creates a page for the images and data. It creates a entry in the database but it will not add the images. Below are some log files maybe someone could tell me why. I thought it was a permission sort of thing but I cant figure where. I change from one server where it was working to another where its causing this problem. I just cant figure out what the problem is.

/var/www/vhosts/my.com/httpdocs/admin/admin_model_photo_detail.php on
line 42, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Notice: Undefined
index: fileIcon in
/var/www/vhosts/my.com/httpdocs/admin/admin_model_photo_detail.php on
line 58, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Notice: Undefined
index: fileIcon in
/var/www/vhosts/my.com/httpdocs/admin/admin_model_photo_detail.php on
line 59, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Notice: Undefined
variable: HTTP_POST_VARS in
/var/www/vhosts/my.com/httpdocs/admin/admin_model_photo_detail.php on
line 106, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagecreatefrompng(../model_images/watermark.png)
[function.imagecreatefrompng]: failed to open stream: No such file or directory
in /var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 125,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagealphablending(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 126,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagesavealpha(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 127,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagesx(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 131,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagesy(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 132,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagecopy(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 135,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagedestroy(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 138,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagesx(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 42,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagesy(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 43,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning: Division
by zero in /var/www/vhosts/my.com/httpdocs/include/resizeimage.php on
line 53, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image
dimensions in /var/www/vhosts/my.com/httpdocs/include/resizeimage.php on
line 83, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagecopyresampled(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 84,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagejpeg(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 85,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagedestroy(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 46,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagesx(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 42,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagesy(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 43,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning: Division
by zero in /var/www/vhosts/my.com/httpdocs/include/resizeimage.php on
line 53, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image
dimensions in /var/www/vhosts/my.com/httpdocs/include/resizeimage.php on
line 83, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagecopyresampled(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 84,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagejpeg(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 85,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagedestroy(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 46,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagesx(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 42,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagesy(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 43,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning: Division
by zero in /var/www/vhosts/my.com/httpdocs/include/resizeimage.php on
line 53, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image
dimensions in /var/www/vhosts/my.com/httpdocs/include/resizeimage.php on
line 83, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagecopyresampled(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 84,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagejpeg(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 85,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Warning:
imagedestroy(): supplied argument is not a valid Image resource in
/var/www/vhosts/my.com/httpdocs/include/resizeimage.php on line 46,
referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
[Tue Dec 02 20:23:17 2014] [client 61.12.45.30] PHP Notice: Undefined
variable: HTTP_POST_VARS in
/var/www/vhosts/my.com/httpdocs/admin/admin_model_photo_detail.php on
line 536, referer:
http://my.com/admin/admin_model_photo_detail.php?model_id=C5073898114
0
Comment
Question by:smphil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40481774
Looks like you were using an old version of PHP and you have now moved to a modern version where things like $HTTP_POST_VARS have been deprecated.
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 40482040
You never want to add images to a database.  The reasons are many and complicated, but they will eventually hinder performance and backup.  Instead, store your images in the server file system and put the image URLs in the database.  If you want to tell us in a little more detail how this process is expected to work (at a high level - nothing technical, just what you have for input and what you want for output) we can probably suggest a reliable design pattern.
0
 
LVL 1

Author Comment

by:smphil
ID: 40484634
GARY
I think your correct the person who made the program is very behind the times what version of php do you think they are using to run this program. I guess I could could just run that version to get this thing working for the time being.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 111

Expert Comment

by:Ray Paseur
ID: 40484637
Don't downgrade PHP.  You really, really, really want to refactor this code. To learn why, follow this link to the search results.  Old versions of PHP have as many holes as Swiss cheese.
https://www.google.com/search?q=php+security+vulnerabilities
0
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 40484663
Do you have access to the php.ini file - if you do and you are on PHP v5.3 or lower then you can reenable things like HTTP_POST_VARS with

    register_long_arrays = On

Which will probably fix the other errors in the process.
0
 
LVL 1

Author Comment

by:smphil
ID: 40485667
Gary I am using V5.2.17  SHOULD I BE ABLE to change the things using the php.ini with that version.
0
 
LVL 58

Expert Comment

by:Gary
ID: 40485674
Yes
0
 
LVL 1

Author Comment

by:smphil
ID: 40485677
Gary so I should try turning on the register_long_arrays ?
0
 
LVL 58

Expert Comment

by:Gary
ID: 40485679
Yes
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question