...

View Full Version : Help with "Invalid ID"



ElMaitron
09-19-2009, 12:43 PM
Hi Guys! I'm new here. I have a website micomunidad.com and I have a section called "answers". I can post questions but when answering them I get "Invalid ID".

I'm learning PHP but this is a little to advance for me.

This is what it shows at the view_question.php file:

<?php
include("includes/top_new.php");
include("classes/answers.class.php");
$answers = new answers;
$question_id = $_GET["question_id"];
if($question_id == Null || !is_numeric($question_id))
{
exit("Invalid ID");
}
$question_set = $answers->get_question($question_id);
?>
<!-- Top.php -->
<html>

I would like to know what is causing it! I check the dB and it looks fine.

At the answer.class.php it shows this:

function add_answer($member_id,$question_id,$answer,$subject,$rating)
{
$time = strtotime("now");
$date = date("d/m/Y g:h:s");

$sql="insert into answers_answers";
$sql.="(member_id";
$sql.=", question_id";
$sql.=", answer_text";
$sql.=", answer_subject";
$sql.=", rating";
$sql.=", added_date";
$sql.=", added_time)";

$sql.=" values($member_id";
$sql.=", $question_id";
$sql.=", '$answer'";
$sql.=", '$subject'";
$sql.=", $rating";
$sql.=", '$date'";
$sql.=", '$time')";

$res = mysql_query($sql);
if($res)
{
return 1;
}
else
{
return 0;
}

Thank you for your time! :thumbsup:

Fou-Lu
09-19-2009, 04:20 PM
Can you put this before the if statement and post the result:


printf("Request: %s, Querystring: %s\n", $_SERVER['REQUEST_METHOD'], $_SERVER['QUERY_STRING']);

SKDevelopment
09-19-2009, 05:03 PM
The code you have posted could output "Invalid ID" here:


$question_id = $_GET["question_id"];
if($question_id == Null || !is_numeric($question_id))
{
exit("Invalid ID");
}


It is not output by the code which works with the DB. It is output if question_id is not present in the URL query string or question_id is not numeric. What I mean your URL's must always look like


http://micomunidad.com/view_question.php?question_id=5

(I used "5" but it could be any appropriate number).

If question_id is not set i.e. the URL looks like


http://micomunidad.com/view_question.php

or question_id is not numeric i.e. the URL looks like


http://micomunidad.com/view_question.php?question_id=foo

you would get "Invalid ID" output by your code.

The code you have posted does not allow to say with which GET parameters view_question.php is called. I am afraid we would need to see more code to understand why question_id is absent or is not numeric.

ElMaitron
09-19-2009, 08:54 PM
Thank you SKDevelopment

My URLs always look like (this is a question ID sample):

http://www.micomunidad.com/view_question.php?question_id=16 but when trying to answer I get "Invalid ID"

I have the folder with all files. If anybody is willing to help I would give them the MOD so we can solve this issue. It cost me over $100.00 :D but, inthe name of learning! I really want to learn!!!

Fou-Lu
09-20-2009, 03:05 AM
Can you put this before the if statement and post the result:


printf("Request: %s, Querystring: %s\n", $_SERVER['REQUEST_METHOD'], $_SERVER['QUERY_STRING']);


What is the output from the above?

SKDevelopment
09-20-2009, 10:59 AM
I have looked at your site. When the button "Submit Your Answer", the JavaScript function add_answer() sends an AJAX request to the PHP script ajax_scripts/add_answer.php.

The AJAX request to ajax_scripts/add_answer.php is sent by POST, not by GET.

I'll try to guess, but I could be wrong (since I did not see the code of add_answer.php): if add_answer.php contains similar checking code like view_question.php, I mean


$question_id = $_GET["question_id"];
if($question_id == Null || !is_numeric($question_id))
{
exit("Invalid ID");
}

then "Invalid ID" would be certainly returned. This is because in add_answer.php it is necessary to get question_id from $_POST, not from $_GET.

Still this is just a guess. I have not seen the code of add_answer.php, so I could not say for sure. Could you post the code of the file

ajax_scripts/add_answer.php

Just in case: Of course if the code contains logins, passwords or any other sensitive data, they must be replaced e.g. with "***" before posting.

2 Fou-Lu: I am sorry to say that, but if answer.class.php is invoked in ajax_scripts/add_answer.php (which would be logical - this is where the answer is saved...), then I would bet the answer to your question would be


Request: POST, Querystring:

(since ajax_scripts/add_answer.php is called by POST which follows from the the JavaScript code at the posted hyperlink). This is just a guess though ... I hope ElMaitron would say if I was wrong about it ...

Fou-Lu
09-20-2009, 07:34 PM
I have looked at your site. When the button "Submit Your Answer", the JavaScript function add_answer() sends an AJAX request to the PHP script ajax_scripts/add_answer.php.

The AJAX request to ajax_scripts/add_answer.php is sent by POST, not by GET.

I'll try to guess, but I could be wrong (since I did not see the code of add_answer.php): if add_answer.php contains similar checking code like view_question.php, I mean


$question_id = $_GET["question_id"];
if($question_id == Null || !is_numeric($question_id))
{
exit("Invalid ID");
}

then "Invalid ID" would be certainly returned. This is because in add_answer.php it is necessary to get question_id from $_POST, not from $_GET.

Still this is just a guess. I have not seen the code of add_answer.php, so I could not say for sure. Could you post the code of the file

ajax_scripts/add_answer.php

Just in case: Of course if the code contains logins, passwords or any other sensitive data, they must be replaced e.g. with "***" before posting.

2 Fou-Lu: I am sorry to say that, but if answer.class.php is invoked in ajax_scripts/add_answer.php (which would be logical - this is where the answer is saved...), then I would bet the answer to your question would be


Request: POST, Querystring:

(since ajax_scripts/add_answer.php is called by POST which follows from the the JavaScript code at the posted hyperlink). This is just a guess though ... I hope ElMaitron would say if I was wrong about it ...

We'll need confirmation, but that was what I was expecting as output. Its simply the wrong request method.

ElMaitron
09-21-2009, 12:21 AM
What is the output from the above?

I did but I did not see anything!

ElMaitron
09-21-2009, 12:25 AM
I have looked at your site. When the button "Submit Your Answer", the JavaScript function add_answer() sends an AJAX request to the PHP script ajax_scripts/add_answer.php.

The AJAX request to ajax_scripts/add_answer.php is sent by POST, not by GET.

I'll try to guess, but I could be wrong (since I did not see the code of add_answer.php): if add_answer.php contains similar checking code like view_question.php, I mean


$question_id = $_GET["question_id"];
if($question_id == Null || !is_numeric($question_id))
{
exit("Invalid ID");
}

then "Invalid ID" would be certainly returned. This is because in add_answer.php it is necessary to get question_id from $_POST, not from $_GET.

Still this is just a guess. I have not seen the code of add_answer.php, so I could not say for sure. Could you post the code of the file

ajax_scripts/add_answer.php

Just in case: Of course if the code contains logins, passwords or any other sensitive data, they must be replaced e.g. with "***" before posting.

2 Fou-Lu: I am sorry to say that, but if answer.class.php is invoked in ajax_scripts/add_answer.php (which would be logical - this is where the answer is saved...), then I would bet the answer to your question would be


Request: POST, Querystring:

(since ajax_scripts/add_answer.php is called by POST which follows from the the JavaScript code at the posted hyperlink). This is just a guess though ... I hope ElMaitron would say if I was wrong about it ...

This is the code found at ajax_scripts/add_answer.php:

<?php
session_start();
header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); // disable IE caching
header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . " GMT" );
header( "Cache-Control: no-cache, must-revalidate" );
header( "Pragma: no-cache" );
include("../includes/db-conn.php");

include("../classes/answers.class.php");
$answers = new answers;

$member_id = $_SESSION["member_id"];
$question_id = addslashes($_POST["question_id"]);
$rating = addslashes($_POST["rating"]);
if($question_id == Null || !is_numeric($question_id) || $member_id == Null || !is_numeric($member_id) || !is_numeric($rating))
{
exit("Invalid ID");
}

$subject = addslashes($_POST["subject"]);
$answer = addslashes($_POST["answer"]);

// add comment
if($answer == Null || $member_id == Null)
{
print "Invalid entry, Answer was not added, please try again.";
}
else
{
$res = $answers->add_answer($member_id,$question_id,$subject,$answer,$rating);
if($res==1)
{
print "Answer posted succesfully";
}
else
{
print "A mysql error occured and answer was not added at this time, please try again later!";
}
}
?>

SKDevelopment
09-21-2009, 07:25 AM
Try to replace


exit("Invalid ID");

in ajax_scripts/add_answer.php with:


exit("Invalid ID: question_id=$question_id; rating=$rating; member_id=$member_id");

and please show the result here. Then please reverse the change.

Maybe $_SESSION["member_id"] is not set or is not numeric ?

ElMaitron
09-21-2009, 06:54 PM
Try to replace


exit("Invalid ID");

in ajax_scripts/add_answer.php with:


exit("Invalid ID: question_id=$question_id; rating=$rating; member_id=$member_id");

and please show the result here. Then please reverse the change.

Maybe $_SESSION["member_id"] is not set or is not numeric ?

I get Invalid ID: question_id=15, rating=undefined, member_id=171

Please check out attached image

http://www.micomunidad.com/images/answers.jpg

Thankx!

Fou-Lu
09-21-2009, 07:14 PM
Rating is indicated as undefined, making it null. !is_numeric($rating) when $rating is null returns false, causing you to drop into the exit. That can be resolved with replacing this:


$question_id = addslashes($_POST["question_id"]);
$rating = addslashes($_POST["rating"]);

with this:


$question_id = isset($_POST['question_id']) ? (int)$_POST['question_id'] : 0;
$rating = isset($_POST['rating']) ? (int)$_POST['rating'] : 0;

Note that since you're treating these as integer values, you're safer casting to an integer than trying to addslashes to the text. If the text doesn't pass an atoi than it will return 0.

SKDevelopment
09-21-2009, 07:43 PM
For me


var rating = document.getElementById("rating").value;

in the function add_answer() works in FF but does not work in IE8.

So your code should work in FF, but not in IE with which you are testing according to the image.

The problem is taking place despite the value for rating is always selected, the IE does not get it from document.getElementById("rating").value. And I could not get it (even with different JS) till I changed the id for select from rating to rating1. This is strange since you have 2 elements with name "rating" - select element and meta-tag, but only 1 element with id "rating".

Still after I changed


<select id="rating" name='rating' size='1'>

to


<select id="rating1" name='rating' size='1'>

and used the function add_answer() with the following code:


function add_answer(question_id)
{
var subject = document.getElementById("subject").value;
var answer = document.getElementById("answer").value;
var el = document.getElementById("rating1");
var rating1 = el.options[el.selectedIndex].value;

if(answer == '')
{
alert("You did not enter any answer, please enter one to continue");
}
else
{
var url="ajax_scripts/add_answer.php";

var params="question_id=" + escape(question_id) + "&subject=" + escape(subject) + "&answer=" + escape(answer) + "&rating=" + escape(rating1);
http.abort();
http.open("POST", url);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.send(params);
http.onreadystatechange=response_add_answer;
}
}

the code seemed to work in both browsers ...

Could you check if such a modification would work for you ?

Edit1: corrected typo with id="rating" and id="rating1" - please use the current code.

Edit2: 2 Fou-Lu: Your code is good of course! But "undefined" is clearly produced at the client side. If the OP does only the server side correction, the script will work for him. But if the JavaScript works not correctly in IE, the ratings would be always saved with zero values in IE, since they would be submitted as "undefined" and converted to 0. So your code is good, but the client-side correction is necessary anyway.

ElMaitron
09-21-2009, 11:15 PM
SKDevelopment ,
I did the changes you made. When someone answers a question, it says: "Answer posted successfully". See image below:

http://www.micomunidad.com/images/answers1.jpg

And when I view the question, I see that someone has posted an answer but it won't say the answer. See image below:

http://www.micomunidad.com/images/answers1a.jpg

Also, when I clicked "Top Answered" and click the question under Posted answers, it tells me "No Answers have been posted for this question yet!
" see image below:

http://www.micomunidad.com/images/answers2.jpg

This is great! Thank you guys!

ElMaitron
09-23-2009, 12:39 AM
:( So what's next? Can you guys tell me?

Fou-Lu
09-23-2009, 02:23 AM
The ID's are different between the two. One is 17 and the other is 10. Is it possible that the one listed under 10 just has no replies?

Check that handling of the add_answer method - you're parameters are mixed up. The subject is being interpreted as the answer and vice versa:


// Method signature
function add_answer($member_id,$question_id,$answer,$subject,$rating);

// Method Call:
$res = $answers->add_answer($member_id,$question_id,$subject,$answer,$rating);

See that the method expects the memberid, questionid and then the answer, not the subject. This is likely because the original intent was to make these as optional values, and the answer first is more logical.

So, replace you're method call with this:


$res = $answers->add_answer($member_id,$question_id, $answer, $subject,$rating);


Try that.


One other thing to change I'd recommend. In that add_answer method, drop the call to strtotime and just use time(). Time will return the current timestamp, and is faster than strtotime (especially if its like the 30 / 31 day of the month)

ElMaitron
09-23-2009, 08:29 PM
The ID's are different between the two. One is 17 and the other is 10. Is it possible that the one listed under 10 just has no replies?

Check that handling of the add_answer method - you're parameters are mixed up. The subject is being interpreted as the answer and vice versa:


// Method signature
function add_answer($member_id,$question_id,$answer,$subject,$rating);

// Method Call:
$res = $answers->add_answer($member_id,$question_id,$subject,$answer,$rating);

See that the method expects the memberid, questionid and then the answer, not the subject. This is likely because the original intent was to make these as optional values, and the answer first is more logical.

So, replace you're method call with this:


$res = $answers->add_answer($member_id,$question_id, $answer, $subject,$rating);


Try that.


One other thing to change I'd recommend. In that add_answer method, drop the call to strtotime and just use time(). Time will return the current timestamp, and is faster than strtotime (especially if its like the 30 / 31 day of the month)


You guys have been such a GREAT HELP!!! Thank you a lot!

ElMaitron
09-23-2009, 08:43 PM
One more question? if you know it - it will be a blessing but if nOT i will have to live with it:

As you can see the website is in both ENGLISH/SPANISH. Whe I tried to asnwer something in spanish I can't type special characters such as , , , and so on...Where can I fix this at the dataBse side and/or some where in the script of the page?

Fou-Lu
09-24-2009, 03:54 AM
PHP shouldn't convert it, but it will prove problematic should you wish to operate on the string (substr for example).
You'll need to change the storage engine for it, so alter you're database column's collation for the fields and bump it from latin (guessing thats probably what it is), to utf-8 general ci.
If its an input problem, that is likely the browser in use. PHP cannot control the charset input, only for the output.

ElMaitron
09-25-2009, 01:04 PM
All the changes were GREAT!!! the MOD is now working. But, I have a little problem. I don't know if it is related to the changes ( Don't think so but...) but I have received Emails from new members and even existing members that they can't "Upload / Change Photos". Once they log in and click this option "Upload / Change Photos" it takes them to "Upload Photographs " but when trying to upload it gives this error messgae "There was an error!". What could it be? These started happening NOT too long after I did those changes...WEIRD!!! Ha! Please I need your HELP!!! :( :(

ElMaitron
09-25-2009, 05:39 PM
Well, I fixed the upload problem because it was a CHMOD issue (777) with the user_image folder, I changed it to 777. Now, If some one signs up (new member) and skips the upload image part but then later the same member wants to upload an image when clicking "Upload / Change Photos" it will take you to the "Upload Photographs " page and lets you "Browse" for an image and "Save changes" and it tells me "Your image has been uploaded." but when I want to "Edit My Photos" click the link it tells me: "There are no images uploaded yet." What could be the problem? it worked before!

This is the code for the upload_photos.php:


<?php

ob_start("ob_gzhandler");

session_start();

if ($_SESSION["logged_in"]!="yes")

{

print ("<script language='JavaScript'> window.location='login.php'; </script>");

}

else

{

include("includes/top.php");

include("includes/nav.php");

include("includes/conn.php");

//include("includes/right.php");

?>

<tr>

<td valign="top" bgcolor="#FFFFFF">

<!-- middle_content -->

<p align='center'>

<table width='100%'>

<tr>

<td width='20%'>

<?php

include("includes/right_menu.php");

?>
</td>
<td width='80%' valign='top'>
<table width='100%' align='center' class='dark_b_border2' cellspacing='0' cellpadding='4'>
<tr>
<td colspan='2' class='dark_blue_white2'>
Upload Photographs
</td>
</tr>
<form name='UploadImages' action='upload_photos1.php' ENCTYPE='multipart/form-data' method='post'>
<tr>
<td width='30%' class='txt_label'>Caption: </td>
<td width='70%' class='txt_label'>
<input type='text' size='40' name='caption'><BR>
</td>
</tr>
<tr>
<td width='30%' class='txt_label'>Image: </td>
<td width='70%' class='txt_label'>
<input type='file' size='40' name='image'><br>
Allowed Formats: *.jpg,*.jpeg,*.png,*.tif,*.gif
</td>
</tr>
<tr>
<td width='100%' colspan='2' class='login'>
<p align='center'>
<input type='submit' name='submit' value='Save Changes'></p>
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<!-- middle_content -->
<!-- Middle Text -->
<?php
include("includes/bottom.php");
}
?>

This is the code for upload_photos1.php:


<?php
ob_start("ob_gzhandler");
session_start();
if ($_SESSION["logged_in"]!="yes")
{
print ("<script language='JavaScript'> window.location='login.php'; </script>");
}
else
{

function func_makethumb_avatar_upload($filename,$width,$ext)
{
//describe dynamic image resize function for uploading user avatars and delete original
ob_start(); //output buffering
$thumb_quality = 60; // JPEG image quality (0-100) for thumbnails
$thumb_width = $width; // resized images will have this width
$req_dir = getcwd();// get current working directory

$avatar_url = $filename;//path to image

if (file_exists($avatar_url)){
list($width, $height, $type, $attr) = getimagesize($avatar_url); //...get its size and stuff like that and...
if ($width != $thumb_width && $width > $thumb_width)
{
//...if the thumbnail is not the same size as $thumb_width we need to resize it so...

if($ext=="jpg"||$ext=="jpeg")
{
$image_handle = imagecreatefromjpeg($avatar_url); //
}
if($ext=="png")
{
$image_handle = imagecreatefrompng($avatar_url); //
}

if($ext=="gif")
{
$image_handle = imagecreatefromgif($avatar_url); //
}

if($ext=="bmp")
{
$image_handle = imagecreatefrombmp($avatar_url); //
}

if($ext=="tif")
{
$image_handle = imagecreatefromtif($avatar_url); //
}

$thumb_height = round(($thumb_width / $width) * $height); //resizing etc
$thumbnail = imagecreatetruecolor($thumb_width, $thumb_height) or
$thumbnail = imagecreate($thumb_width, $thumb_height);
imagecopyresampled($thumbnail, $image_handle, 0, 0, 0, 0, $thumb_width, $thumb_height, $width, $height);
unlink($avatar_url);//now delete the original
imagejpeg($thumbnail, $avatar_url, $thumb_quality); //actually create a jpg from $thumbnail, store it in location $avatar_url, with quality $thumb_quality

imagedestroy($image_handle); //clear buffer #*$!
imagedestroy($thumbnail);
ob_end_flush();
//end output buffering
}
}
}

include("includes/top.php");
include("includes/nav.php");
include("includes/conn.php");
?>

<tr>
<td valign="top">
<!-- middle_content -->
<table width='100%' cellpadding="0" cellspacing="0">
<tr>
<td width='25%' valign='top'>
<!-- middle_content -->
<?php
include("includes/right_menu.php");
?>
</td>
<td width='1%'>&nbsp;</td>

<td width='80%' valign='top'>
<table width='100%' align='center' class='dark_b_border2' cellspacing='0' cellpadding='4'>
<tr>
<td colspan='2' class='dark_blue_white2'>
Upload Photographs
</td>
</tr>

<tr>
<td width='100%' colspan='2' class='txt_label'>

<?php
if(!empty($_FILES["image"]))
{
$result=mysql_query("select max(photo_id) as a from photos");
$num_rows=mysql_num_rows($result);
$data_set=mysql_fetch_array($result);
if($num_rows==0)
{
$picture_id=1;
}
else
{
$picture_id=$data_set["a"]+1;
}

$file_name1=$_FILES["image"]["name"];
$ext = strtolower(end(explode('.', $file_name1)));
if($ext!="jpg"&&$ext!="jpeg"&&$ext!="png"&&$ext!="tif"&&$ext!="gif")
{
print "<b>Err# The image format you uploaded is not supported by our system.</b>";
print "<br><a href='upload_photos.php'>Add more photos</a>";
print "<br><a href='logincomplete.php'>Return to home</a>";
}

else
{

$picture_name=$_SESSION["member_id"].$picture_id."90998".".".$ext;
$picture_url="user_images/".$picture_name;
$result = move_uploaded_file($_FILES["image"]["tmp_name"], $uploaddir.$picture_name);

if($result)
{

$file_name=$uploaddir.$picture_name;
func_makethumb_avatar_upload($file_name,400,$ext);
$res=chmod($file_name,0755);

$caption = addslashes($_POST["caption"]);
$invite_only = $_POST["invite_only"];
if($invite_only=="on")
{
$invite_only = 1;
}
else
{
$invite_only = 0;
}

$sql="insert into photos";
$sql.="(member_id";
$sql.=", caption";
$sql.=", invite_only";
$sql.=", photo_url)";
$sql.=" values($_SESSION[member_id]";
$sql.=", '$caption'";
$sql.=", $invite_only";
$sql.=", '$picture_url')";
$result=mysql_query($sql);
$photo_id = mysql_insert_id();

include("classes/friendactions.class.php");
$friend_actions = new friend_actions;

$check = $friend_actions->add_new_photo($_SESSION["member_id"],$photo_id);



print "<b>Your image has been uploaded.</b>";
print "<br><a href='upload_photos.php'>Add more photos</a>";
print "<br><a href='logincomplete.php'>Return to home</a>";

}
else
{
print "<b>There was an error!</b>";
print "<br><a href='upload_photos.php'>Add more photos</a>";
print "<br><a href='logincomplete.php'>Return to home</a>";
}


}
}
else
{
print "<b>There was an error!</b>";
print "<br><a href='upload_photos.php'>Add more photos</a>";
print "<br><a href='logincomplete.php'>Return to home</a>";

}
?>
<br />
<div align='center'>
<?php
$ads_set = $ads->get_top_300_banner();
$upd = $ads->update_impr($ads_set["campaign_id"]);

if($ads_set["banner_code"]!=Null)
{
?>
<?=stripslashes($ads_set["banner_code"])?>
<?php
}
else
{
if($ads_set["banner_type"] == 2)
{
?>
<a href='track_ad_link.php?campaign_id=<?=$ads_set["campaign_id"]?>&url=<?=$ads_set["banner_url"]?>' target='_blank'>
<img src='<?=$ads_set["banner_file"]?>' width='300' height='250' border='0'/>
</a>
<?php
}
if($ads_set["banner_type"] == 3)
{
?>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="300" height="250" id="banner" ALIGN="">
<PARAM NAME=movie VALUE="<?=$ads_set["banner_file"]?>?clickTAG=track_ad_link.php?campaign_id=<?=$ads_set["campaign_id"]?>&url=<?=$ads_set["banner_url"]?>">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED src="<?=$ads_set["banner_file"]?>?clickTAG=track_ad_link.php?campaign_id=<?=$ads_set["campaign_id"]?>&url=<?=$ads_set["banner_url"]?>" quality=high bgcolor=#FFFFFF WIDTH="300" HEIGHT="250" NAME="banner" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
<?php
}
}
?>
</div>
</td>
</tr>

</table>
</td>
<td width='1%'>&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- middle_content -->
<!-- Middle Text -->
<?php
include("includes/bottom.php");
}
?>

Fou-Lu
09-26-2009, 02:20 AM
Can you post the code you use to edit this? I've really only paid attention to the move_uploaded_file section, where the error could potentially occur. It looks like the problem will either exist in call to the function func_makethumb_avatar_upload, the modification script, or the database storage:


$sql="insert into photos";
$sql.="(member_id";
$sql.=", caption";
$sql.=", invite_only";
$sql.=", photo_url)";
$sql.=" values($_SESSION[member_id]";
$sql.=", '$caption'";
$sql.=", $invite_only";
$sql.=", '$picture_url')";



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum