Ask two questions: php imagecreatefromjpeg and ajax.

Source: Internet
Author: User
Tags blank page
Ask two questions: php's imagecreatefromjpeg and ajax 1. under what circumstances will the imagecreatefromjpeg function crash and jump out of the current connection?
The current situation is that I have a file of more than 500 K, and the file gets stuck every time the thumbnail is generated. No error is Prompted. a blank page is displayed. This problem does not occur for others that are larger than 1 MB.

Is there any other solution besides modifying php. ini?
2. when I use ajax:
JQuery. ajax ({type: "post", url: "dialog. php? A = sift ", data: {" cid ": n," data ": d}, dataType:" json ", success: function (data, textStatus) {if (data. res = 0) {alert (data. msg);} after else {/******* succeeds ******/}}});


Can I still pass a json Array to d? But why is Stack Overflow reported after I pass it?


Reply to discussion (solution)

JQuery. ajax ({type: "post", url: "dialog. php? A = sift ", data: {" cid ": n," d}, dataType: "json", success: function (data, textStatus) {if (data. res = 0) {alert (data. msg);} after else {/******* succeeds ******/}}});


Fix It. add a color for the d above.

JQuery. ajax ({type: "post", url: "dialog. php? A = sift ", data: {" cid ": n," data ": d}, dataType:" json ", success: function (data, textStatus) {if (data. res = 0) {alert (data. msg);} after else {/******* succeeds ******/}}});

Dizzy, I don't know whether it's my computer card or the csdn card. I deleted more. this time it's okay.

1. when the total number of pixels of an image exceeds the preset value of GD
However, I have not seen any description about the upper limit. in the past, php4 seemed to have a upper limit of 1024*768.
But you can test it yourself.

Ini_set can dynamically set variables that can be modified


2. {"cid": n, "data": d}
If d = {"cid": n, "data": d}
It must be "Stack Overflow" because it is recursive.
Jq is sent only after the js object is constructed into a string.

Understand. Thank you, moderator.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.