Jump to content

SilverJester

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Everything posted by SilverJester

  1. Having trouble trying to validate a user name and password. This is my code: //check username/password $user_name_check = mysql_query("SELECT * FROM users WHERE user_name=" . $_POST["user_name"] . "\" AND password=" . $_POST["password"] . "\""); if(mysql_num_rows($user_name_check)) { //Do stuff here... } But I get the following error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /xxxx/xxxxxxxx/xxxxx/xxxxxxxxxxxxx/xxxx.php on line 32 Any ideas as to why? $user_name_check is a result set right (which is what the mysql_num_rows() requires)??
  2. ah ok I found a solution: imagealphablending($image, false); imagesavealpha($image, true); I added those two lines before saving the file. But I'm honestly not sure what they are doing, maybe someone would be willing to explain it?
  3. I'm trying to write a script that will copy images from one website (a supplier, in this case puma) and save them to the dealer's web server. I have already done this for other supplier's websites but puma uses png's instead of jpeg's and I believe that is what is causing my issues: The original image looks like this: The copied image some odd colors in the background like this: Here is the code: $puma_image = "http://www.pumab2b.com/_static/images/styleColors/1234560002/" . str_replace(" ", "", $Item_Num) . "_1.png"; $image = imagecreatefrompng($puma_image); if ($image) { //Save image to Soccer Etc server (images folder): if (imagepng($image, "prod_images/" . $cur_Item['Item_Num'] . ".png", 0)) { //DO some other stuff here } } I just noticed after posting the original image on this forum, that it is actually transparent. I'm guessing this has something to do with my problems?
×
×
  • 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.