|
jasonbar posted:
This is working perfectly, thank you! Now to answer your question as to what I am doing, exactly: http://www.ecarddialer.com Thanks again! Treytor fucked around with this message at 11:55 on Jul 23, 2008 |
# ? Jul 19, 2008 05:37 |
|
|
# ? May 16, 2024 05:41 |
|
I need to find a library that allows for the creation of php to pdf on the fly. So far I have found fpdf.org and tcpdf.org to be the best, does anyone have any experience with either library? The built-in pdf support in php5 is not good enough for what i need to create. thanks!
|
# ? Jul 28, 2008 20:54 |
|
Dirk Pitt posted:I need to find a library that allows for the creation of php to pdf on the fly. So far I have found fpdf.org and tcpdf.org to be the best, does anyone have any experience with either library? The built-in pdf support in php5 is not good enough for what i need to create. thanks! I've used the ezPDF extension with PHP before and it wasn't too terrible. You may want to check that one out too.
|
# ? Jul 28, 2008 21:20 |
|
Dirk Pitt posted:I need to find a library that allows for the creation of php to pdf on the fly. So far I have found fpdf.org and tcpdf.org to be the best, does anyone have any experience with either library? The built-in pdf support in php5 is not good enough for what i need to create. thanks! domPDF will take an html page formatted with css2.1 and convert it to a pdf. It's really nice and it's free. http://www.digitaljunkies.ca/dompdf/
|
# ? Jul 28, 2008 21:36 |
|
I made a friend of mine a WordPress site a few weeks ago, and on the site he has some news articles as well as original posts. I'm trying to figure out a way to have all the original posts on the home page, and all the news articles on a News page. I have all the news posts in the category "news" as well as the tag "news" and I can get all the original posts on the home page by using this code:code:
|
# ? Jul 29, 2008 00:00 |
|
EDIT: Fixed - moved the "AddType" commands into the mime type section, apparently the guide I read was incorrect. So i'm trying to set up php5.2.6 and apache 2.2.9 on my win xp sp2 box. I'm able to get apache running, but when I try to access a php file it returns a blank page (blank as in nothing in the source). I have the following lines in my httpd.conf: code:
code:
TIA jimbroof fucked around with this message at 03:02 on Jul 29, 2008 |
# ? Jul 29, 2008 02:27 |
|
WHORENDOUS posted:Am I missing something? Is there something else I need to have running to parse php? In my experience, The CGI version of PHP 5 has always had a problem installing for me in IIS 6 that I tracked down to long paths with spaces in them. What happens when you try to install PHP to C:\PHP ?
|
# ? Jul 29, 2008 02:36 |
|
Zorilla posted:In my experience, The CGI version of PHP 5 has always had a problem installing for me in IIS 6 that I tracked down to long paths with spaces in them. What happens when you try to install PHP to C:\PHP ? Same thing :/
|
# ? Jul 29, 2008 02:42 |
|
I am catching my rear end to enable the gd library in php5. extension=php_gd2.dll is uncommented. Apache has been restarted several times since. Is there anything else that needs to be done to get the gd library enabled? Do I have to change anything in Apache? Here's my phpinfo: http://dev.babaya.net/test.php Jam2 fucked around with this message at 00:08 on Jul 30, 2008 |
# ? Jul 30, 2008 00:06 |
|
Jam2 posted:I am catching my rear end to enable the gd library in php5. Is there a specific error message and did you compile it with GD enabled?
|
# ? Jul 30, 2008 01:35 |
|
drcru posted:Is there a specific error message and did you compile it with GD enabled? Problem solved. the gd.dll was not in the extension folder. Copied it across and it worked. Also: Where should extensions be held? I read a guide on php that said c:\win\system32. Shouldn't they be kept in c:\php5\ or does it just depend on each individual installation?
|
# ? Jul 30, 2008 01:37 |
|
Jam2 posted:Problem solved. the gd.dll was not in the extension folder. Copied it across and it worked. This is a bit fuzzy in my head, but I think extensions only end up in c:\windows\system32 if no other path is specified in php.ini. By default, isn't it usually set to C:\PHP\ext or something? Maybe that's only if you use the MSI installer.
|
# ? Jul 30, 2008 01:41 |
|
I'm building a small comment system for a website and currently using PHP / XML / jQuery framework. When someone posts a comment, I'm doing an htmlspecialchars before putting it into the database. However, when I grab this data as XML and use jQuery to prepend it to the page, javascript seems to translate back all the special-chars and output them as HTML. End result: Tags like <a> and </a> are special-char when viewing the database row, but once it gets sent via XML to jQuery and outputted, they go back to <a> and </a>. 1) Is htmlspecialchars the best way to prevent against script/link injections? 2) Any fix to this (some sort of htmlspecialchars for jQuery?) Thanks!
|
# ? Jul 30, 2008 04:08 |
|
arkiteKt posted:1) Is htmlspecialchars the best way to prevent against script/link injections? 1) It seems ok. Also, if you have any queries that involve user input, make sure they're properly escaped. Somebody else recommended to me before that you should probably store inputs into the database as purely as possible and then encode them upon reading them. (With XML, use CDATA blocks to store things like < and > in a way that doesn't conflict with the XML structure) 2) This is AJAX, right? I'm assuming you're retreiving the XML with jQuery. According to this, you can use the html() method to encode special characters. Javascript or jQuery might be responsible for decoding your data on read. The data is encoded in the XML file, right? Zorilla fucked around with this message at 04:43 on Jul 30, 2008 |
# ? Jul 30, 2008 04:26 |
|
arkiteKt posted:I'm building a small comment system for a website and currently using PHP / XML / jQuery framework. I don't know exactly but I think you're looking for this: http://www.w3schools.com/jsref/jsref_escape.asp
|
# ? Jul 30, 2008 14:58 |
|
Zorilla posted:2) This is AJAX, right? I'm assuming you're retreiving the XML with jQuery. According to this, you can use the html() method to encode special characters. Thanks for your help, the jQuery docs were down last night and I figured it was something easy like this! I was using the .html() method to set the html of the <li> element, but simply calling that was having the effect of translating all the special-chars back into html. Using .text() before that call ensures the special-chars stay that way!
|
# ? Jul 30, 2008 15:17 |
|
Any of you guys work with multi-language sites? Current system we use is like this: php:<? require_once('translations/thispage_thislanguage.php'); echo $translations['welcome']; ?> php:<? $translations['welcome'] = 'Welcome to our site etc etc'; ?> Anyone use anything more sophisticated? One thought has been language "packs" that get included in any relevant pages (a downloads "pack", etc), which pulls everything out of a database (bonus: can be updated by non-developers.)
|
# ? Jul 30, 2008 19:50 |
|
nikjohns posted:This works, but it leads to repetition of translations, and no way to fall-back to English if the default phrase / language combo isn't available. To fall back on english, include the english translation first, then include the alternate language. That way anything missed by the alternate language will have already been assigned by the english pack.
|
# ? Jul 30, 2008 19:53 |
|
duz posted:To fall back on english, include the english translation first, then include the alternate language. That way anything missed by the alternate language will have already been assigned by the english pack. You're quite right, and to clarify: This is already in use on a ridiculous number of pages, so while we could go back and fix it like that, we'd prefer a proper one off solution to make it awesome. Or at least not crap.
|
# ? Jul 30, 2008 20:24 |
|
Use gettext. Looks like this: php:<? $some_string = _("Welcome to our site");?> code:
You'll need to write a script to extract the strings from your code. The xgettext tool already supports extracting them from PHP, but you may need something custom for Smarty.
|
# ? Jul 30, 2008 21:12 |
|
In the process of creating a CMS Made Simple module, I've encountered a bit of a poser. To test to see if it was something "wrong" with CMSMS or PHP itself, I created a simplified version of my poser:php:<?php // index.php class Coolio { function Coolio() { require_once("inc.php"); } function WhatIsIt($string) { return "<p>WhatIsIt is being called from ".$string."</p>"; } } $nothing = new Coolio(); ?> php:<? // inc.php echo $this->WhatIsIt("Coolio"); SubCoolio(); function SubCoolio() { echo $this->WhatIsIt("SubCoolio"); } ?> code:
Unboxing Day fucked around with this message at 22:13 on Jul 30, 2008 |
# ? Jul 30, 2008 22:03 |
|
I would like to put together a team of PHP developers to do develop sites for companies under the management group that I work for. We're based in the Caribbean, and there aren't many good developers available. I'm turning to you guys here on the forums I want to put together a team of up-and-coming developers/designers to work part-time and long distance for our company. I don't need to see a huge portfolio of work or clientele. Just looking for some people interested in working on some cool projects. I honestly don't have a handle on the technical side of development (poo poo... it's ALL technical)so I am also looking for an experienced PHP developer-goon to serve as a consultant and/or team coordinator. Some of the things we will be developing: -general site design and CMS development -news site design -audio streaming (from our two B&M radio stations) -live voting, interactive apps -chat apps -SMF and wordpress customization All in all, it will be about 6 or 7 web sites within the next year. Some of the sites will be revenue generating platforms and there will be opportunities for equity share. Also, is this even the right place to post this? If not, where should I put this?
|
# ? Jul 30, 2008 22:14 |
|
Emo Businessman posted:I know that I can 'fix' the error by simply passing a $this reference to SubCoolio, but I am curious as to why $this disappears as soon as the function in the include is called. What's happening here? php:<?php // index.php class Coolio { function Coolio() { // inc.php echo $this->WhatIsIt("Coolio"); SubCoolio(); function SubCoolio() { echo $this->WhatIsIt("SubCoolio"); } } function WhatIsIt($string) { return "<p>WhatIsIt is being called from ".$string."</p>"; } } $nothing = new Coolio(); ?>
|
# ? Jul 30, 2008 22:17 |
|
Jam2 posted:Also, is this even the right place to post this? If not, where should I put this? You'll probably want to make an entirely new thread in this forum for the most responses. Also, enable your email in your control panel so us losers without premium accounts can send you a message!
|
# ? Jul 30, 2008 22:34 |
|
Stephen posted:Also, enable your email in your control panel so us losers without premium accounts can send you a message! I'm not sure - would you want someone without a platinum account to work for you? I know I wouldn't
|
# ? Jul 30, 2008 22:57 |
Stephen posted:Also, enable your email in your control panel so us losers without premium accounts can send you a message! Maybe after your first paycheck you can splurge on some platinum and support the forums that helped you get the new job!
|
|
# ? Jul 30, 2008 23:26 |
|
Stephen posted:You'll probably want to make an entirely new thread in this forum for the most responses. Email enabled and thread posted: Assembling a team of up-and-coming developers/designers (Inquire Within)
|
# ? Jul 31, 2008 00:12 |
|
Anyone know what it means when mb_detect_encoding returns an empty string? Clearly it's failing at detecting the encoding, but the drat thing has to have some encoding (and it should be UTF-8). Also, when I try to call mb_convert_encoding on the same strings, I get an error about not being able to detect the encoding type, which sort of makes sense considering the first problem.
|
# ? Aug 1, 2008 15:36 |
|
Munkeymon posted:Anyone know what it means when mb_detect_encoding returns an empty string? Clearly it's failing at detecting the encoding, but the drat thing has to have some encoding (and it should be UTF-8). I've found it really hard to reliably detect an encoding. And it doesn't help that some people seem to equate Windows-2352 with ISO-8859-1.
|
# ? Aug 1, 2008 18:12 |
|
minato posted:UTF8 looks identical to ASCII if all the character codes are below 127. OK, so does anyone know a better way to find (and corect) the encoding? I think I stopped using utf8_encode because mb_* supported more encodings. Also: quote:Encoding (used by Opera): Munkeymon fucked around with this message at 15:29 on Aug 4, 2008 |
# ? Aug 1, 2008 21:01 |
|
I use a complicated system that involves throwing the text out to this little application that's used in Firefox's test harness. The app's job is to help test the encoding detection of Firefox, you just send it some text via stdin and it tells you what it thinks the encoding is. But apart from requiring the app to shell out to an external program, it requires building Firefox from source with all the test stuff enabled which is a horrible process. Thankfully I don't have to do it very often - just when trying to parse NNTP/mail posts from Outlook which breaks standards by not including the encoding.
|
# ? Aug 1, 2008 23:01 |
|
I want to keep track of all the places somebody's been on a map in an array (possibly). What would the best way to store this on MySQL? Note: they may not be visiting these places in order. The places will just be represented by numbers. I was thinking textfield in the database separated by commas. But that doesn't sound so efficient.
|
# ? Aug 2, 2008 03:18 |
|
drcru posted:I was thinking textfield in the database separated by commas. But that doesn't sound so efficient. How big is this project? If you think you can fit what you need inside VARCHAR fields instead of using LONGTEXT, go for it, but unless this project is huge, you probably won't see any performance difference. According to this, it looks like you'd only save 3 bytes of space for data 232 - 1 characters or less if you went with VARCHAR instead of LONGTEXT. If you're just talking about storing multiple pieces of data in a single field, JSON is probably the way to go since you can make your lists multidimensional if need be and PHP already provides functions for converting these strings to and from arrays. For instance, one person's data could look like this: php:<? $data = array( "name"=>"Joe Blow", "locations"=>array( "Brockway", "Augdenville", "North Haberbrook" ), "didthetripsuck"=>true ); ?> code:
Zorilla fucked around with this message at 12:42 on Aug 2, 2008 |
# ? Aug 2, 2008 05:19 |
|
Thanks but unfortunately we don't have PHP5 installed yet . How crappy and or efficient are serialize and unserialize? The array may reach up to 375 items per person and map so I'm a little worried about how well it would handle if there are, worst case, 5000 users and 15 maps.
|
# ? Aug 2, 2008 10:31 |
|
drcru posted:Thanks but unfortunately we don't have PHP5 installed yet . You can install the JSON stuff through PECL if you want (I believe this will work through PHP4), or ZendFramework has one also. serialize will work, but then you need to write it out to a file each time. Which will work, but if you have easy access to a mysql db, you should set it up in there. It could get kind of messy, but you'd have multiple tables. Users (which contains a users_id, datetime column, place_id, rating, etc) Places (which contains the places_id, name, location, features about that place, etc) Pretty easy to join from Users to Places to get your data out, just figure out the user id, select them all out joining on places, ordering by time. If the places are always going to be unique (like long/lat) then you could probably just put that data right in the users table.
|
# ? Aug 2, 2008 19:45 |
|
I'm creating a little quiz script and I'm looking for ideas on how I can ask the database if the answer they have clicked on is correct without transmitting any visable indication in the source that he should click a certain one. My database fields (that we'll use in this query) are q_id (Unique ID of that question) q_question (The question at hand) q_correcta (The correct answer) q_seconda (A wrong answer) q_thirda (Another wrong answer) q_fourtha (The last wrong answer) I could transmit the answer back php:<? <input type="button" value="Answer Here">?> Would I need to have a variable inside each form with an md5 of the answer like so (x4) php:<? <form method="POST"> <input type="hidden" name="answer" value="xxxxxMD5HERExxxxx"> <input type="submit" name="Answer1" value="This Is Answer 1"></p> </form>?>
|
# ? Aug 3, 2008 04:15 |
|
Safety Shaun posted:quiz stuff
|
# ? Aug 3, 2008 09:05 |
|
Safety Shaun posted:I could transmit the answer back
|
# ? Aug 3, 2008 09:11 |
|
You could just give each answer a value of 1-4 then store in the database what number of answer is correct. Compare the answer to the input, no crazy characters.
|
# ? Aug 3, 2008 11:27 |
|
|
# ? May 16, 2024 05:41 |
|
MrEnigma posted:You can install the JSON stuff through PECL if you want (I believe this will work through PHP4), or ZendFramework has one also. What are your thoughts on just using implode/explode?
|
# ? Aug 3, 2008 13:50 |