Jump to content

php error on website and not on mine


jagguy

Recommended Posts

I am using flash/php and are getting errors on php (free web hosting site) which i don't get on  my localhost.

I don't get any error on my localhost but i get 3 error which I can't fix.

flash part
---
send_lv.alName=combo1.value
send_lv.sendAndLoad("http://jagguy.ej.am/flash/snlCombo.php", nameVars, "GET");

php
------
errors

Notice: Undefined index: alName in /home/jagguy/public_html/flash/snlCombo.php on line 6


Nothing to display from photoAlbum :
Display more photos
Notice: Undefined variable: i in /home/jagguy/public_html/flash/snlCombo.php on line 42

Notice: Undefined variable: file in /home/jagguy/public_html/flash/snlCombo.php on line 51
files=

php file snlCombo.php
--
<?php

include("dbconnect.php");

$alName="";
$alName=$_GET["alName"];
$sql4="select id from album where Name='$alName' ";
$result4 = mysql_query("$sql4")    or die("Invalid query: " . mysql_error());
$nt2=mysql_fetch_array($result4) ;
$alNum=$nt2['id'];



$sql = "SELECT * FROM image2    WHERE (del !='deleted' or del is null)  and
    albumId='$alNum'";
  // is null ORDER BY id DESC  LIMIT $offset, $itemsPerPage";

// $sql = "SELECT * FROM image2  WHERE (del !='deleted' or del is null) and  albumId='2'";

$result = mysql_query($sql)    or die("Invalid query: " . mysql_error());

//echo mysql_num_rows($result);

if (mysql_num_rows($result)==0)
{
  echo "<br><br>Nothing to display from photoAlbum :".$alName;
  echo  "<br> <a href='viewPhoto.php'>Display more photos </a> ";
}
else
{
  $i=1;
  //$nt=mysql_fetch_array($result) ;
  while($nt=mysql_fetch_array($result))
  {
    $file[$i]=$nt['filename'];
    $i++;

  }

}

$total=$i-1;
$filestr="";

for($j=1;$j<$total;$j++)
{
  $filestr=$filestr.$file[$j].",";

}
//need to add last file on its own
$filestr=$filestr.$file[$total];
$files="files=".$filestr;
echo $files ;



?>


i have no idea how to fix this.
Link to comment
Share on other sites

It all works fine. The file snlCombo is part of a flash script which calls it.

flash part
---
send_lv.alName=combo1.value
send_lv.sendAndLoad("http://jagguy.ej.am/flash/snlCombo.php", nameVars, "GET");

You wouldn't run the file on its own as it expects a value and returns a value. Now on my machine it works fine so whats with these errors, and is fixing this means this will work properly on another website anyway.
Link to comment
Share on other sites

[quote author=jagguy link=topic=123965.msg513090#msg513090 date=1169722904]
You wouldn't run the file on its own as it expects a value and returns a value.
[/quote]

I'm fully aware of that, but by adding the line I suggested and running the code again, you'll be doing some debugging.  Identifying if the value that actually gets passed to the php script from Flash is actually what you expect.

Regards
Huggie
Link to comment
Share on other sites

The thing is is that it does pass the value correctly on my machine. On my machine it was thouroughly tested in all aspects. I never would port a program without testing such things.
To have the same code fail on another website is confusing. I will have to create a smaller program and test it on the other website with just sendnload from flash.

Obviously there are a few time consuming quirks  here.

thanks for the replies by the way.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.