Hey everyone. I have a question. I have a web scraper that grabs
information from web pages that often contain characters such as vowels
with umlots (I know I spelled that wrong.)
The data is editable, so the characters show up unmodified in an
editable text box. However, when I try to import t
Daniel Brown wrote:
> Welcome to the list, James.
Thanks :)
> Check out htmlentities(): http://php.net/htmlentities
I'll check that out.
James
--
"Black holes are where God divided by zero." --Steven Wright
signature.asc
Description: OpenPGP digital signature
Ross McKay wrote:
> One restriction I know (knew?) of is that you can't run DOS programs
> under Wine on 64-bit, but then... why?
I could be wrong, but I'll bet anything that Wine made use of the now
defunct vm86 component of the x86 architecture. That allowed the CPU to
implement a "virtual mac
Hey everyone. I've been reading the list for a long time, but have only
really posted to the mailing list a few times. I just had a quick
question about MySQL. I'm not sure if this is exactly relevant to PHP,
but it is for a PHP application I'm writing, so hopefully that makes
this question
Hey everyone,
Long time reader, not such a long time poster :-P (though I have posted
to the list occasionally in the past...)
Anyway, I have a general question for the list. Basically, I need to
maintain persistent objects between page refreshes. So, for example, if
while running a PHP script
Martin Scotta wrote:
> You can use $_SESSION to store the object, and serialize to convert to
> string and reverse
I like that idea. I think I may end up going that route.
I have one question. This is VERY hypothetical, and mostly just to
satisfy a curiosity, but let's assume that you write an
Hey everyone. I have a question. Hopefully it's clear, because I'm not
sure quite how to ask it. Basically, I have a variety of different
objects that a variable can be instantiated as in the same block of
code, its type being determined at runtime. I want to be able to do
something like this:
Ah, thanks very much. That was very helpful!
James
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Richard Quadling wrote:
> $ pecl install haru
> [...]
> $ phd -f pdf -t phppdf -d .manual.xml
I installed haru, yet when I try the phd command, I get a "class
'HaruDoc' not found" error :( Has this happened to anyone else?
James
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe
Hey everyone,
I've been hard at work on a new web application, and discovered
something that I would never have seen coming. I was noticing that when
I called session_start() after a few lines of includes, I was getting
complaints because the HTTP headers had already been sent out. Then,
after p
Eddie Drapkin wrote:
> HTTP headers are sent and finalized after the first bit of output. I
> had the same problem before and it turned out to be because I had a
> close tag "?>" at the end of a file followed by some whitespace. The
> solution was to remove the ?> from the end of all the files
Zareef Ahmed wrote:
> You should get a "headers already sent output started at " kind of error
> if you have enabled error reporting with display_errors ON.
Actually, I did. I just didn't think to mention it in my first post.
The thing was that it said it was coming from one of my includes,
John Butler wrote:
> if($_POST['UserWishesDateRange']) { //--line 79
> echo'submitted';
> } else {
> echo'NOT submitted';
> }
Try this instead:
if (isset('UserWishesDateRange'])) {
// [...stuff goes here...]
}
James
--
"Black holes are where
Hey everyone! I have a question. I know that you can use fopen to open
not just local files, but also files via HTTP. My question is, assuming
you're attempting to open a page that has popups, is there anyway to get
at the actual content underneath the popup?
Thanks!
James
--
PHP General Mai
Ralph Deffke wrote:
> have u tried?
>
> I did not, but as far as I understand u getting the stream including the
> html causing the browser to open an popup.
>
> so what is ur real problem then?
Yeah, ummm...
Sorry for the traffic. That was a really stupid question... It looks
like the format
Hey everyone. I ran into a really weird issue that I was hoping I could
find some clarification on. In short, I have javascript functions that
operate on hidden text values. Those values may be posted, in which
case PHP then prints them back to the page via what comes in on $_POST.
The weird th
Andrew Ballard wrote:
> Javascript interpolates \n as a newline character inside both double
> and single quotes unlike PHP that only interpolates inside double
> quotes. If the client browser is running under Windows, it may even be
> possible that the \n is recognized by the browser as a line te
Lars Nielsen wrote:
> Hi,
>
> How do i access a variable from inside a class?
Add the following statement:
global $template_dir;
James
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Nisse Engström wrote:
> It may be the browser that is converting those line breaks.
Ah. That's probably it then. I didn't realize that was a part of the
HTML standard. Thanks!
James
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hey everyone. I have an array that looks like this:
$main_array[0] = array('key1' => 'vala');
$main_array[1] = array('key1' => 'valb');
etc.
I want to sort the main array based on the value of key1 for each
sub-array. I looked at all the array sorting functions, but unless I
misunderstood somet
Eddie Drapkin wrote:
> http://us3.php.net/uasort
Exactly what I was looking for. Thanks.
James
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hey everyone, I was pretty sure there was an easy built-in solution for
what I want to do, but I've been googling around with no luck.
Basically, I just want to take a string containing the output of
print_r() and convert it back into an array again.
That is possible, right? If so, how do I go ab
Hey everyone. I'd been troubled for a while by the fact that inserting
cut-pasted special characters such as ä caused truncation when passed to
MySQL, then discovered that it was because I was cutting and pasting unicode
values into non-unicode Latin-1 strings.
Since Latin-1 also has equivalent v
Andrew Ballard wrote:
> Have you tried iconv or mb_string? Is it a option to update the
> database to use UTF-8?
I'll look into those functions. And, I suppose I could in fact convert my
database to use UTF-8 if necessary.
James
--
PHP General Mailing List (http://www.php.net/)
To unsubscrib
tedd wrote:
> May 2010 > 2009.
Fortunately, I think that's automatically true by definition :-D
James
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Lars Nielsen wrote:
Is it save to assume that I can use the same SQL, or should i make some
exceptions?
Standard SQL should work across all SQL servers with only a few
exceptions (for example, MySQL doesn't support full outer joins.)
Anything that has to do with server administration, howeve
Hey everyone,
I have a question. If I do a mysql query that updates a column in a row
to the same value, I get 0 rows affected. However, I also get 1 or more
matched rows. Is there a way that I can return the number of matched
rows, rather than the number of rows affected?
I'm trying to get s
Floyd Resler wrote:
> As for as I know, MySQL simply just doesn't report a row as being affected if
> nothing has changed in it. To get the number of matched rows, try doing a
> SELECT query before you do the UPDATE query. I don't know if that will
> produce the results you're looking for, but
I'm pretty sure this is the right answer. If not, someone please
correct me. PHP will compare the 0 against the integer represented by
the string. So, for example, 0 == "0" would test true. 0 == "1" would
test false. However, 'heading' doesn't represent a valid integer, so it
appears on the ri
Hey everyone,
I have a question about logins. Let's say that I want to allow each
user account to login only once at a time. I would then need some kind
of locking mechanism to make sure that the same user can't login again
somewhere else until first logging off. What's a good way to achieve
th
Tommy Pham wrote:
> 1) Set an encrypted (to prevent hijacking and eavesdropping) cookie to
> expire when browser closes
> 2) Have a table in the DB backend to keep track if the user is logged in or
> not and when was the last time the validated user access your site (this
> gets updated when the u
Hey guys,
Haven't posted in a long time... Happy Memorial Day! I have an issue
with exception handling. I'm using a framework that throws a
"Database_Exception" object. I was expecting catch (Exception $var) to
be sufficient to catch this, but it doesn't. I have to do catch
(Database_Exc
On 06/01/12 07:30, ma...@behnke.biz wrote:
James Colannino hat am 1. Juni 2012 um 16:25
geschrieben:
Hey guys,
Haven't posted in a long time... Happy Memorial Day! I have an issue
with exception handling. I'm using a framework that throws a
"Database_Exception" obje
On 06/01/12 08:08, James Colannino wrote:
On 06/01/12 07:30, ma...@behnke.biz wrote:
James Colannino hat am 1. Juni 2012 um 16:25
geschrieben:
Hey guys,
Haven't posted in a long time... Happy Memorial Day! I have an issue
with exception handling. I'm using a framework tha
On 06/01/12 07:32, Mackintosh, Mike wrote:
Hi James,
You would have to catch Database_Exception. It is also good practice to
also always catch exception afterwards.
Hey Mike,
Thanks for the reply! I saw this comment in the documentation
(http://www.php.net/manual/en/language.exceptions.ext
On Fri, Jun 1, 2012 at 12:51 PM, Marco Behnke wrote:
Ah, I guess that is the problem. Your application framework uses namespaces.
> I guess you should try
>
> catch (\Exception $e)
>
> instead of
>
> catch (Exception $e)
>
> :-)
>
Ah, that was probably it. Will try it out tonight to confirm. T
Hey everyone,
After reading the documentation for mysqli_query(), I was lead to
believe that on any error it would return false. However, through a
stupid mistake, I discovered that when I specify an invalid value for
the database link identifier (in my case, I accidentally passed an
integer
On 06/18/11 13:27, Ashley Sheridan wrote:
> You'll only get an error if there was an error with the query. A query that
> has no result is still a valid query, so won't return an error. It's quite
> common to check the value of mysql_num_rows() before trying to use the
> results of the query.
Hi everyone,
I don't post all that often, so I hope my (mildly) off-topic question
won't be too unwelcome... Keep in mind that I'm still pretty new when
it comes to security, so what I propose may or may not sound incredibly
dumb (you have been warned! :-P)
I'm working on a project in PHP, a toy
On 08/16/11 01:30, Lester Caine wrote:
> All the good sites simply don't have that capability ...
> Much safer rather than 'recovering' a password is to identify the user,
> and send them a temporary password which they have to change when they
> log in. This way nobody is allowed access existing
On 08/16/11 02:08, Richard Quadling wrote:
> Take a look at https://code.google.com/p/loginsystem-rd/
>
> Whilst it is just a login system, the techniques here could be adapted
> and probably learned from (if you are new to security).
Ah, that looks interesting. Thanks for the link!
James
--
Jochem Maas wrote:
> that said I have no idea if there are any *nix based word doc
> manipulators, if there
> are they probably won't work with all versions of word documents - the
> file format is
> closed and changes from version to version.
OpenOffice.org (the website is the same as the name)
Hey everyone! I'm very new to PHP, and had a somewhat general question
(forgive me if it's too broad in scope.) Basically, I'd like to be able
to have a single PHP application that remembers its state as users click
on links. When the user clicks on a link, though, the user unavoidably
re-re
tedd wrote:
James:
Hey tedd, thanks for the response!
1. A $_SESSION variable;
After googling briefly on the subject of sessions, it looks like this is
probably the way I'd want to go. I like this idea, because I can
modularize the code and call different php scripts for different
acti
Hey everyone,
I have a little bit of a quandry. I need to strip HTML tags from user
input, but I also need to convert \n's from the textarea elements to
tags so it will display properly in a browser.
nl2br() works just fine, but if I use strip_tags first, then run nl2br,
nl2br won't work a
Chris wrote:
RTM.
Supply the tags you want to keep when you call strip_tags.
$stripped = strip_tags($data, '');
I can do that, but my question had to do with strip_tags seeming to get
rid of \n's, not tags. This is why I was concerned. If I run
strip_tags(), followed by nl2br, the tags
Chris wrote:
Are you sure there are newlines before you run strip_tags?
I would assume so, because everything from the textarea runs together in
one line when displayed in the browser until filtered through nl2br().
That would suggest to me that there are indeed \n's that are being
converte
James Colannino wrote:
Chris wrote:
Are you sure there are newlines before you run strip_tags?
I would assume so, because everything from the textarea runs together in
one line when displayed in the browser until filtered through nl2br().
That would suggest to me that there are indeed \n
Hey everyone. Here's a simple question. I'd like to be able to import
information from a text file located on the client without actually
saving it on the server; that is, I simply want to read the data into
memory on the server, without actually saving it to a file.
I've been googling aroun
Boyd, Todd M. wrote:
IIRC, if you never move it out of PHP's defaulted temporary storage
sandbox, it will eventually be wiped. When files are uploaded via PHP,
they must explicitly be moved into the active file system.
Ah, I see. What would happen if two people just happened to upload
files
Nitsan Bin-Nun wrote:
PHP uses randomaly name for each of them (during the upload to the
temporary directory), when its done PHP moves the file to the objective
location, i dont think you will obstacle filename problems.
Ah, excellent! Thanks :)
James
--
My blog: http://www.crazydrclaw.com/
51 matches
Mail list logo