jagguy Posted January 25, 2007 Share Posted January 25, 2007 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.valuesend_lv.sendAndLoad("http://jagguy.ej.am/flash/snlCombo.php", nameVars, "GET");php------errorsNotice: Undefined index: alName in /home/jagguy/public_html/flash/snlCombo.php on line 6Nothing to display from photoAlbum :Display more photosNotice: Undefined variable: i in /home/jagguy/public_html/flash/snlCombo.php on line 42Notice: Undefined variable: file in /home/jagguy/public_html/flash/snlCombo.php on line 51files=php file snlCombo.php--<?phpinclude("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. Quote Link to comment Share on other sites More sharing options...
HuggieBear Posted January 25, 2007 Share Posted January 25, 2007 You should read up about [url=http://uk.php.net/manual/en/ref.errorfunc.php]error reporting[/url] within php.Also the [url=http://uk.php.net/manual/en/function.error-reporting.php]error_reporting()[/url] functionRegardsHuggie Quote Link to comment Share on other sites More sharing options...
jagguy Posted January 25, 2007 Author Share Posted January 25, 2007 I still don't get this. If you just supress error does that mean it still won't work properly. Do I need to fix the errors and why did they come up anyway? Quote Link to comment Share on other sites More sharing options...
HuggieBear Posted January 25, 2007 Share Posted January 25, 2007 OK, my advice would be to add this line to the top of your script, just below include("dbconnect.php");[code=php:0]echo $_GET['alName'];[/code]Does it output the value you're expecting?Huggie Quote Link to comment Share on other sites More sharing options...
jagguy Posted January 25, 2007 Author Share Posted January 25, 2007 It all works fine. The file snlCombo is part of a flash script which calls it.flash part---send_lv.alName=combo1.valuesend_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. Quote Link to comment Share on other sites More sharing options...
HuggieBear Posted January 25, 2007 Share Posted January 25, 2007 [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.RegardsHuggie Quote Link to comment Share on other sites More sharing options...
jagguy Posted January 25, 2007 Author Share Posted January 25, 2007 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.