Jump to content

sloth456

Members
  • Posts

    171
  • Joined

  • Last visited

    Never

Everything posted by sloth456

  1. Can you tell us what the output is or provide a link we can view for ourselves?
  2. Don't you need to put: $counterval = $counterval+1; mysql_query("UPDATE tickets SET counter = '$counterval' where tick_id = '$ticketid'"); inside the while loop?
  3. say I have a large array of words e.g: apple,pear,orange,etc I would like to split the aray into smaller arrays every 500 characters, without actually splitting any words. Is there an easy way to do that. If you need me to explain again I'd be happy to.
  4. ok, well this is a very inelegant way to do it, but this is how I normally parse info out of stuff try /:.+?<big><b><span.*?>(.*?)</span><\/b><\/big>/ I use .*? as a way of saying "skip over whatever is here" and (.*?) for "grab whatever is here" Hope that helps.
  5. hmmm, well I'm out of ideas, unless you or whoever is hosting put php under safe mode in which case shell_exec wouldn't work. Just read that at the php manual ^^
  6. could it be this mysqldump moveitho_sitebuilder profiles -h%s -u%s -p%s > %s it says "moveitho" should that be "moveito" Sorry if I'm being completely idiotic, I'm not familiar with shellexec(), it just struck me as looking a bit like a typo.
  7. There's a lot of regex pattern matches in that array, but no command that actually parses out the data. Could you please post the full code. I imagine, somewhere further down is a preg_match command.
  8. You use a cron to do bits of it in chunks and store the results in a database.
  9. I'm afraid I haven't taken the time to look over your code in detail, but would in_array() be what you're looking for?
  10. You can get a visitors I.P address in php. I'm supposing you could then see which coutry the I.P belongs to and then toggle the pricing between US or Ca depending on the result. However, you would probably need a list of I.P. ranges for the seperate countries.
  11. plus I think you made a mistake on this line print "<tr><td>Emperor</td><td>Score</td><br>"; Shouldn't that be print "<tr><td>Emperor</td><td>Score</td></tr>"; You had <br> instead of </tr> at the end
  12. So you're importing data from the clients computer and saving it on your host? That's what the code looks like it's doing, so it's not actually exporting? I'm not sure exactly what you're doing, I think this little tutorial could be useful though http://www.tizag.com/phpT/fileupload.php It shows you how to create one of those "browse files" input boxes and put it on your host.
  13. ok, this should be quite an easy one. First, to grab the contents of those files look into using file_get_contents(); Once you have 4 seperate strings with their contents you can add them all together like this. $alltextfilesinone=$text1.$text2.$text3.$text4; And then to write it all to a new file on your hosting you should look into fwrite();
  14. No problem, please click the "solved" button right at the bottom of this page somewhere so that others can see the topic was solved.
  15. Yes this is totally possible and not hard to do if you know how. But at the moment you haven't got a clue (as you have already stated) and it will be very difficult for you to communicate specific problems since you don't know what they are yet. I would suggest you get yourself a basic php book like "php and mysql for dummies" (thats the one I have) and see where it takes you.
  16. hmmm, looks ok to me, put this at the end of your update statement like so $insert_movie1 = mysql_query("UPDATE members SET rate = '$rate' WHERE username = '$myusername'") or die(mysql_error()); Then you should get some sort of error that will help discern the problem, post the error here if you can't figure it out yourself. Another tip: I notice that when you run your mysql query's, you're always putting the result into the $insert_movie variable. like this: $insert_movie = mysql_query("INSERT INTO movie (num, title, rate) VALUES ('$imdb', '$title', '$rate,')"); It's not required, you don't need to put it into a variable, it'll run just fine without like this. mysql_query("INSERT INTO movie (num, title, rate) VALUES ('$imdb', '$title', '$rate,')"); You only ever need to put the result of a mysql_query() in a variable if you're doing a SELECT statement and want to then read through the results.
  17. bump... I'm willing to pay a bounty of $10 to paypal for anyone who can solve this one.
  18. I remember seeing a .ds_store when an apple mac machine interacts with a windows machine on a network. I'm thinking it probably is the problem, if there's anyway to avoid including it I would advise you do.
  19. yeah, sorry. I forgot to include them in the code I posted here, in my actual script the curly brackets aren't missing. I know the first bit of code works. It's the second bit that doesn't. It says imagecolorat(): supplied argument is not a valid Image resource I'm using php version 5.2.8 and gd 2.0.34
  20. ip.php does not connect to your database, it only stores the details. In the code you have posted here, you have not connected to your database in resetpass.php You need to put: mysql_connect("$dbhost", "$dbuser", "$dbpass") or die('<body bgcolor=897C6C scroll=no><font color=red><center>Error connecting to mysql.</font><br><button onclick=history.go(-1)>OK</button>'); mysql_select_db("$dbname") or die ('<body bgcolor=897C6C scroll=no><font color=red><center>Error connecting to Database.</font><br><button onclick=history.go(-1)>OK</button>'); Right after include '../ip.php'; in resetpass.php
  21. Shouldn't you be using an INSERT statement to add to your database rather than replacing an existing record?
  22. The resetpass2.php is only used to notify the user of success/failure. But why would you need to connect again, when you have already stated that you have connected in ip.php which is included in both resetpass.php an restpass2.php I suppose what I'm getting at is : are you 110% sure you have already connected to your database in resetpass.php before you start selecting tables. To clarify you could post the code that is in ip.php, obviously editing out any database usernames and passwords.
  23. I don't understand. Why is it then, in resetpass2.php you have these lines <?php mysql_connect("$dbhost", "$dbuser", "$dbpass") or die('<body bgcolor=897C6C scroll=no><font color=red><center>Error connecting to mysql.</font><br><button onclick=history.go(-1)>OK</button>'); mysql_select_db("$dbname") or die ('<body bgcolor=897C6C scroll=no><font color=red><center>Error connecting to Database.</font><br><button onclick=history.go(-1)>OK</button>'); ?> but you do not have these lines present in resetpass.php
  24. in resetpass.php you haven't actually intiated a connection to your database or selected your database using mysql_connect and mysql_select_db, unless you've already done it in ip.php
  25. I'm having a little trouble, it's difficult to explain so I'll start with my code. <?php $file = 'test.jpg'; // Get the dimensions list($width, $height) = getimagesize($file); // Define our source image $source = imagecreatefromjpeg($file); // Creating the Canvas $bwimage= imagecreate($width, $height); //Create our 2 colours $white = imagecolorallocate($bwimage, 255, 255, 255); $black = imagecolorallocate($bwimage, 0, 0, 0); //Reads the origonal colors pixel by pixel for ($y=0;$y<$height;$y++) { for ($x=0;$x<$width;$x++) { $rgb = imagecolorat($source,$x,$y); $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> & 0xFF; $b = $rgb & 0xFF; //if red is 255 and green is over 197 then colour in black, else colour in white if($r=255 and $g>197) { imagesetpixel($bwimage,$x,$y,$black); } else { imagesetpixel($bwimage,$x,$y,$white); } ?> As you can see I've created a black and white image from the original jpeg. Now I want to read the new image pixel by pixel. I assumed I could read straight from $bwimage as follows: <?php $rgb = imagecolorat($bwimage,$x,$y); $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> & 0xFF; $b = $rgb & 0xFF; ?> But it tells me it's an invalid resource. I'm not very familiar with the GD library and am so close to finishing my script! Can someone shine any light on this?
×
×
  • 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.