premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
Try these headers: /* Your other code above, minus the image/png header */ $image = imagecreatefromstring($row['thumb']); header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="'.$filename.'"'); //<<< Note the " " surrounding the file name header('Content-Transfer-Encoding: binary'); header('Connection: Keep-Alive'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . strlen($image)); echo $image; ?> Making necessary changes like the file name. You only use the image/png header when you want to display the image.
-
That is what I said wasn't it?
-
I just cranked out my latest Article / Blog type site, lxt.me and wanting some feedback on it. It is very simple just meant for me and was a project that I used to learn more about Symfony2. I am more or less looking for critique on the flow of the site / colors etc, not so much functionality. Thanks!
-
I am offended.
-
Hell on earth? That is my HAVEN!
-
Don't know what you are talking about.
-
You can join the IRC Chat! irc.phpfreaks.com #help / #chat We are very selective (about 20 members) and we are el33t.
-
More than likely it will be a path issue. Do you have display errors turned on and your error_reporting set to E_ALL? If not that would be the first step I do is to try and get an error.
-
Only print text from $variable before defined text string.
premiso replied to Silvar's topic in PHP Coding Help
$pos = strpos($description, 'I hate this part'); if ($pos !== false) { $firstpart = substr($description, 0, $pos); }else { echo 'Section was not found'; } echo $firstpart; Using a mixture of substr and strpos -
I use bash I know of http://sourceforge.net/projects/mysqlcc/ which works decent. The workbench I just hated. The MySQLCC program was the best I found, but I still prefer to use the CLI.
-
Sorry, I tend to take articles written by self proclaimed SEO experts very lightly. http://goo.gl/Qfc9w That is a PDF written by Google about SEO Practices for their search engine. They state that no matter URL format used, they do their best for the relevant content and not just the URL. Now, for other search engines other than Google, it may matter. However, I doubt it matters as much as people think it does and as far as it being the effort just for SEO, I think it is not worth it. However, if you want people to be able to know what they are going to by the URL, then it is worth it. My 2 cents from my experiences.
-
As mikosiko said, remove the <br/> and you will also want to add a \n inside of it for the break. echo "Exec dbo.hiddenprocedure '".$i ."', 350000 \n";
-
You do realize that those URLs do nothing for SEO. They are just friendlier to use / prettier to look at.
-
According to the Sourceforge Code site: $element = $html->find("font[size=-1]", 3); echo "Width is: " . $element->width . '<br />';
-
Because it is the unique identifier? Either or, I would say give it a try to pretty up the URLs and see how it goes, maybe you will then understand why.
-
You will want to use the MySQL LIKE comparison function. $sql= "SELECT * FROM categories WHERE categories_name LIKE '%{$search}%'"; The %'s are wild cards.
-
We cannot assist you unless you provide us with a bit more information. What webserver are you running? What changes did you make before this happened? What are the similar traits to the hyperlinks? And any other relevant information you can think of. Given the error, I moved this to the WebServer form.
-
Because no one has felt like attempting to code it and do it. Last I checked phpBB was OpenSource, you could code it and submit the patch / plugin to get the URLs you want. And also with forums that have tons of users, duplicate topics will probably happen, and it is just easier to use the id's as appose to coming up with an algorithm to handle that.
-
Please Read: http://forums.phpfreaks.com/topic/1895-header-errors-read-here-before-posting-them/ And see if that helps you understand / solve your problem.
-
STOP YELLING AT ME! /me curls up in fetal position rocking back and forth mumbling nonsense.
-
I do not see this being relevant to PHP, as Javascript seems to be more prudent for doing what you need. Moved accordingly.
-
Warning: Creating default object from empty value
premiso replied to Stylock's topic in PHP Coding Help
It is just saying that it is not an object, you can solve it by defining it as a stdClass: function bp_group_hierarchy_setup_globals() { global $bp, $wpdb; /* Define a default class if one has not been instantiated */ if (!is_object($bp->group_hierarchy)) $bp->group_hierarchy = new stdClass(); /* For internal identification */ $bp->group_hierarchy->id = 'group_hierarchy'; // line 22 $bp->group_hierarchy->table_name = $wpdb->base_prefix . 'bp_group_hierarchy'; $bp->group_hierarchy->slug = BP_GROUP_HIERARCHY_SLUG; /* Register this in the active components array */ $bp->active_components[$bp->group_hierarchy->slug] = $bp->group_hierarchy->id; do_action('bp_group_hierarchy_globals_loaded'); } And that should get rid of the warnings. -
Not to mention that DOCUMENT_ROOT is defined by the webserver, so it can be a variation of different items, depending on who setup the web server or even be left off at times. So yea, the __FILE__ method is definitely my preference as well.
-
Using cURL over file_get_contents will be about 3-5times faster than file_get_contents, so if you have the option to use cURL, I would opt for that for a bit more efficiency. Also, you can display the text without echo's using <?php echo $weekly; ?> such as: ?> <strong>How many times have people tweeted #TeamRylan</strong><br /><br /> In the last Hour: <?php echo $hourly; ?><br /> In the last Day: <?php echo $daily; ?><br /> In the last Week: <?php echo $weekly; ?><br /> In the last Month: <?php echo $monthly; ?><br /> Ever: <?php echo $alltime; ?> <br /> Granted the display part is more or less preference, but to me that would be easier to edit not having to worry about quotes etc. Finally, you do not need a foreach, instead just do this: <?php error_reporting(0); $jsonurl = "http://otter.topsy.com/searchcount.json?q=%23teamrylan&type=tweet&apikey=FJWCK5YSZIBEUZX4HYJQAAAAABLTPFQ3DVIQAAAAAAAFQGYA"; $json = file_get_contents($jsonurl, 0, null, null); $json_output = json_decode($json, true); $hourly = number_format($json_output['response']["h"]); $daily = number_format($json_output['response']["d"]); $weekly = number_format($json_output['response']["w"]); $monthly = number_format($json_output['response']["m"]); $alltime = number_format($json_output['response']["a"]); None of this stuff is really necessary, just some items that will help efficiency a little bit, ie not having to loop etc. Best of luck.