Jump to content

DapperDanMan

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.brierrowstudio.com

Profile Information

  • Gender
    Not Telling

DapperDanMan's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Oh yeah, in the meantime. To save anyone else the added trouble, I've added more characters into the str_replace as follows:         $pattern = array("“", "’", "”", "‘", "…"); $replacement = array("\"", "\'", "\"", "\'", "..."); $synop = str_replace($pattern, $replacement, $synopsis); Again, make sure this goes into the code before INSERTing into the mysql database. Now, can anyone tell me why it works on this site? Surely this is ran off some kind of database, right? Why do the special characters work here, but I cannot figure it out on my site?
  2. Wow ShogunWarrior! I didn't expect anyone to do that, thank you very much for checking it out yourself. I have tried dozens of collation variables. I have noticed that on certain occasions, it causes the text inserted into the database to be converted to the '?'. I still need to do more testing and see if I can repeat the problem where that happens. I've also placed a question to my hositing service to see if they know anything about the problem. But I feel that may be a longshot. If I hear back from them with relevent information, I will post it here.
  3. Well I'm happy I am not the only one, but sad that you had to face the same conclusion. I'm thinking about contacting my hosting service and seeing if they have a suggestion.
  4. Well, I have a workaround right now. I am using a str_replace() when inserting the text into the database: $pattern = array("“", "’"); $replacement = array("\"", "\'"); $synop = str_replace($pattern, $replacement, $synopsis); I then use a stripslashes() when I call the information from the database. It isn't the best way I know, but it does work. I would still like to figure out why it is causing problems in the first place and correct it, so if anyone knows, I would really appreciate the help. Thank you
  5. Okay, after some more research (and banging head against the wall) I discovered that the text I am copying has "fancy" quotes and apostrophes. So I tried the other post about htmlentities, but no luck. It didn't change the quotes, just showed the line breaks. So here is the problem, the text I am pulling from is actually of a website and the quotes slant inward. If I change them to the standard quotes that are absolutely vertical, it works fine. See the above example for the style of quotes. Does anyone have any clue why it works on another website, but I cannot pull them from the database?
  6. When you say "encoding" do you mean charset? If so, it is  UTF-8 Unicode (utf8). Now my collation is different. It is latin_general_ci. Could this be the problem?
  7. I have no idea what is going on. the information stored in the mysql database displays correctly within the database: mysql example - “Give th’ man a drink, Belk. However, when it is called from a php file it displays as follows: �Give th� man a drink, Belk. I really am stumped why it cannot pull the text from the database and display it properly. Can anyone enlighten me why it is doing this to the quotes and apostrophes?
  8. ***SOLVED (I think)*** I changed "imagecopyresized" to "imagecopyresampled" and it appears to make the images cleaner when resizing. However, I will still take critiques on my code and if any of you have an even better way to make images look nice, please post it here so that we all can learn. Thank you, DDM [!--quoteo(post=379820:date=Jun 4 2006, 03:37 AM:name=DapperDanMan)--][div class=\'quotetop\']QUOTE(DapperDanMan @ Jun 4 2006, 03:37 AM) [snapback]379820[/snapback][/div][div class=\'quotemain\'][!--quotec--] I am coming across an issue with resizing images using GD. I notice that they are not very clean. Here is an example: GD Resizing: [img src=\"http://oillampstudio.com/element/d_dade/mahsaiid01_jm_tb.jpg\" border=\"0\" alt=\"IPB Image\" /] Photoshop Resizing: [img src=\"http://oillampstudio.com/element/d_dade/mahsaiid01_jm200.jpg\" border=\"0\" alt=\"IPB Image\" /] I am attaching the code (please, I am new to php, so don't yell at me for poor code, please just enlighten me). I am using "imagecreatetruecolor()" which I thought improved image quality as per php.net's snippet (http://us2.php.net/manual/en/function.imagecopyresized.php). I have heard of some plugin thing called magic-something? Is whatever this plugin is called the only way to get good looking resized images? Any help would be very much appreciated. Thank you, DDM [/quote]
  9. I am coming across an issue with resizing images using GD. I notice that they are not very clean. Here is an example: GD Resizing: [img src=\"http://oillampstudio.com/element/d_dade/mahsaiid01_jm_tb.jpg\" border=\"0\" alt=\"IPB Image\" /] Photoshop Resizing: [img src=\"http://oillampstudio.com/element/d_dade/mahsaiid01_jm200.jpg\" border=\"0\" alt=\"IPB Image\" /] I am attaching the code (please, I am new to php, so don't yell at me for poor code, please just enlighten me). I am using "imagecreatetruecolor()" which I thought improved image quality as per php.net's snippet (http://us2.php.net/manual/en/function.imagecopyresized.php). I have heard of some plugin thing called magic-something? Is whatever this plugin is called the only way to get good looking resized images? [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<?php $source_image = $_GET['img_folder'] .$_GET['img_name']; $filename = eregi_replace ('.jpg', '_tb.jpg', $source_image); echo "$source_image<br />"; echo "$filename<br />"; $im = ImageCreateFromJpeg ($source_image); if (!$im){ echo "Could not generate image"; exit; } //header ('Content-type: image/jpeg'); $image_width = ImageSX($im); $image_height = ImageSY($im); $max = 200; echo "Width is: $image_width, Height is: $image_height"; if ($image_width >= $image_height) { $prop = ($image_width / $max); } else if ($image_height >= $image_width) { $prop = ($image_height / $max); } echo" <br /> A proportional reduction would be at: $prop"; $new_width = ($image_width / $prop); $new_height = ($image_height / $prop); echo "<br /> The new size of the image will be: $new_width wide by $new_height tall.<br>"; $thumb = imagecreatetruecolor($new_width, $new_height); imagecopyresized($thumb, $im, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height); imagejpeg($thumb, $filename); imagedestroy($thumb); ?>[/quote] Any help would be very much appreciated. Thank you, DDM
  10. Awesome! I knew there had to be a better, cleaner way of writing this out. Thank you very much. DDM
  11. Awesome! I knew there had to be a better, cleaner way of writing this out. Thank you very much. DDM
  12. I have the following code to change a filename when I am creating a thumbnail on upload: [code] $file = "something.jpg"; $tb_image = explode(".", $file); $array = array($tb_image[0], 'tb.jpg'); $together = implode("_", $array); [/code] I am curious, is there a better way than exploding the name to insert the "_tb" into the middle of the name? DDM
  13. [!--quoteo(post=377386:date=May 26 2006, 02:44 PM:name=Randy)--][div class=\'quotetop\']QUOTE(Randy @ May 26 2006, 02:44 PM) [snapback]377386[/snapback][/div][div class=\'quotemain\'][!--quotec--] Ok, i made a very simple test... [code]<?php     mysql_connect("localhost","electri_ryan","*********");     mysql_query("CREATE DATABASE `forums`") or die(mysql_error()); ?>[/code] When i run this i get the error: Access denied for user: 'electri_ryan@localhost' to database 'forums' Do i have to set privileges or something? 'electri_ryan' has all privileges... [/quote] I have noticed that some ISPs do not allow you to create databases this way. I am only taking a shot in the dark, but can you create a new database from phpMyAdmin? My current ISP does not allow me to do this (I'm sure it has something to do with a server configuration/setup that is beyond me). I can only create new databases within cPanel. Hopefully that explains your mystery, if not, I would love to hear the outcome.
  14. Just to double check, you cannot get the problem to repeat? In other words, you do a query and get the error, doing the exact same query again gets the correct information? DapperDanMan
  15. [!--quoteo(post=376851:date=May 24 2006, 07:50 PM:name=covert215)--][div class=\'quotetop\']QUOTE(covert215 @ May 24 2006, 07:50 PM) [snapback]376851[/snapback][/div][div class=\'quotemain\'][!--quotec--] I'm very new to php. I'm making my own CMS so that my non-html literate friends can update the website. First, the user logs in. If the username and password are correct, a page is generated that contains a textarea for entering what they want. When they click submit, their article is POSTed into another file. What do I need to do to make any submitted article appear on the front page? Assume I know nothing. I need the article to be stored somewhere and then recalled to the index page. I am very good with HTML but I'm just learning php. Does anyone know where I could get a script to base this off of or would anyone be willing to help? Thanks in advance [/quote] Does your web server have a database set up on it (i.e. mysql)? PHP is not a database, but a server side language that works well with databases like mysql. What you are needing is probably not what a script could help you with. You might get close, but you will have to modify it to do what you want. And even then, probably have to set up the database on your own to mesh with the code. I hate to say it, but you are going to have to hunker down and learn the language as well as any database you want to use. The phpfreaks tutorials and articles are good as well as php.net and look for the manual. Don't worry, it isn't much harder than HTML. Good luck. DapperDanMan
×
×
  • 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.