Jump to content

batwimp

Members
  • Posts

    319
  • Joined

  • Last visited

Everything posted by batwimp

  1. You're doing exactly what it says you're doing: passing in a string instead of a resource. You should probably do something like: $theimage = imagecreatefromjpeg($filename); imagecopyresampled($tmp,$theimage,0,0,0,0,$newwidth,$newheight,$width,$height); Not tested.
  2. Stupid question, but are you sure both your installations are the same version?
  3. So what does your $searchSQL variable contain once it's all loaded up (echo it to the screen and post it here), and how does this compare to your GET variable? (i.e. you do a var_dump($_GET) and post it here as well);
  4. If your Securimage file and your PHP file are both in the same folder, try removing the document root from the include path: include_once 'securimage.php'; Next time, post your code inside code tags (found in the editor above the smilies).
  5. Did you remember to include() the Securimage file? Could you post some code? Do you have error reporting turned on?
  6. I didn't see any database code in what was provided. But Psycho's right. You need to be very careful with recursive functions, especially if there are database queries involved. You should always give yourself a way to break out of them if they get out of control. But they can also be very helpful if you don't know how many times a function (or other section of code) will need to be called. Provide some more code and the gurus will be able to help you more than I can.
  7. If you're going to do anything with PHP, it's really in your best interest to learn to implement a database (usually MySQL). You'll be happy you did, and there will be an exponential increase in the amount of stuff you can do with PHP. It's well worth the time.
  8. Have you looked into recursive functions?
  9. There are probably a million ways to make the code more efficient (like just casting the variable into javascript with a single PHP declaration, then just using the javascript variable throughout the code), but JS is not my forte, so work with it till it rocks!
  10. Could you go ahead and mark it solved?
  11. Are those two blocks of code in different files? If so, how are you passing the $error and $mission information to the file that checks them? I feel there may not be enough code to troubleshoot this.
  12. You could try using a counter to access the original array as a parallel: $counter=0; foreach ($data as $k) { if (empty($k['uu'])) { $data['uu'] = $urls[$counter]; $counter++; } echo "<pre>"; echo $k['uu']; //outputs every URL, and if empty shows "Michel" echo "</pre>"; } NOTE: This code is not tested.
  13. My (klunky) way is to use PHP to assign most of the variables in javascript to have unique name so they will operate independently. Keep in mind that to test my code, I had to replace the database implementation with arrays, so when copying it back to your database code, it may not work quite right. But it worked with my test array: <?php $result0 = mysql_query("SELECT * FROM table WHERE field='$value'"); $varvar = 1; while ($riw0 = mysql_fetch_assoc($result0)) { $seconds1 = $value; //// echo out data and set variable for the number of seconds to count down ?> <script language="JavaScript"> var countDownInterval<?php echo $varvar;?>=<?php echo $seconds1 ?>; var c_reloadwidth<?php echo $varvar;?>=200 </script> <ilayer id="c_reload" width=&{c_reloadwidth}; ><layer id="c_reload2" width=&{c_reloadwidth}; left=0 top=0></layer></ilayer> <script> var countDownTime<?php echo $varvar;?> = (countDownInterval<?php echo $varvar;?>)-0+1; function countDown<?php echo $varvar;?>(){ countDownTime<?php echo $varvar;?>--; if (countDownTime<?php echo $varvar;?> <=0){ countDownTime<?php echo $varvar;?>=countDownInterval<?php echo $varvar;?>; clearTimeout(counter<?php echo $varvar;?>); window.location.href="military3.php" //Redirection URL return } var mins = Math.floor(countDownTime<?php echo $varvar;?>/60) var secs = countDownTime<?php echo $varvar;?>-(mins*60) if (document.all) //if IE 4+ document.all.countDownText<?php echo $varvar;?>.innerText = mins+" minutes "+secs+ " "; else if (document.getElementById) //else if NS6+ document.getElementById("countDownText<?php echo $varvar;?>").innerHTML=mins+" minutes "+secs+ " " else if (document.layers){ document.c_reload.document.c_reload2.document.write('Soldiers will be ready in... <span id="countDownText<?php echo $varvar;?>">'+countDownTime<?php echo $varvar;?><?php echo $varvar;?>+' </span> seconds') document.c_reload.document.c_reload2.document.close() } counter<?php echo $varvar;?>=setTimeout("countDown<?php echo $varvar;?>()", 1000); } function startit(){ if (document.all||document.getElementById) document.write('Soldiers will be ready in <span id="countDownText<?php echo $varvar;?>">'+countDownTime<?php echo $varvar;?>+' </span> seconds') countDown<?php echo $varvar;?>() } if (document.all||document.getElementById) startit() else window.onload=startit </script> <?php $varvar++; } ?> so, basically I generated a variable called $varvar and set it to 1, then appended that to the name of the variables you had set up in the first iteration of your javascript write-out. on the next iteration, it appended 2 to all the variable (and function) names. now that they are each their own entity, they operate independently. I hope this helps in some way.
  14. As soon as the soonest timer hits zero, it's going to change the entire page to military3.php. I'm assuming that's not the functionality you're looking for.
  15. If this is the same subject as your original post (using the same code), keep replying to the original post. That way people can read the older posts in that thread and know what you are talking about and it will be easier for people to answer your questions. Post your updated code, too, if you've implemented the above code, and remember to wrap your code in code tags. This keeps the front page unclogged with multiple posts and really lets people help you better when they can read the entire problem from beginning to end. Thanks!
  16. You're not getting your first line because fgets() reads and entire line, then moves the line pointer ahead one. So this line: $week = fgets($paintFile); reads the first line of your text file, doesn't do anything with it, and moves the pointer ahead one. So when you encounter this line: $nextDay = fgets($paintFile); the line pointer is already on line 2, which you are using. And I'm not sure this code is doing what you want it to. Since fgets() reads and entire line, you are adding up your line numbers and not the dollar amounts.
  17. If var_dump isn't showing anything on your screen, you're probably not getting anything back from your database. Double-check your query and make sure you have data in your database that corresponds with your query. If you have something like phpmyadmin or heidisql set up, run the query from inside that and see if it works.
  18. You should keep replying to your original thread instead of starting a new post.
  19. $allies = array(); Here, you are setting up the $allies array. There is nothing stored in this array after you initialize it. $allies[''] = 'Please Select An Opion'; This is a really weird index name. I would suggest changing it to something alphanumeric. foreach ($allies AS $ally) { $ally[$ally->id] = $ally->rosterName; } Here you are doing a foreach through an array that only has one element ('Please Select An Opion') and doing something (strange) with it. You are calling a method on an array index (that doesn't exist) as if it were an object instance, which won't work unless that element of the array is actually an object. You need to populate your actual $allies array with something before you foreach through it.
  20. Are you sure your database is returning results? Try var_dump on the returned rows: while ( $row = mysql_fetch_array($result)) { var_dump($row); and post what it gives you. You also have some funky code going on. You have a switch statement, but you don't do anything with your cases. Also, you end your while block right after the (empty) switch statements. Usually WHILE blocks continue throughout the entire output of the database rows in order to make tables etc. Are you trying to output all of your database row info, or just the last row?
  21. Try changing your || to && if(($strength + $agility + $wisdom + $vitality >=100) && ($class != 'Apprentice' && $class != 'Mage' && $class != 'Priest' && $class != 'Rogue' && $class != 'Scholar' && $class != 'Wanderer' && $class != 'Warrior' && $class != 'Woodsman')) otherwise, it will almost always evaluate to true.
  22. And this is index.php right? the form is posting to itself?
  23. Please post your whole code again as it is. Also, if you still have this line in your code: print_r ($_POST) ; after you've filled out the form and hit the submit button and post the output of that line (it should be an array).
×
×
  • 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.