>> > I would like to take those values away into my third form, which is what
>> > you
>> > see with the hidden. If they are not populated, then how come I could
>> > see
>> > the drop down menus?
>>
>> So you're expecting the values selected in the first two forms to
>> populate the values of the
> How can I go about restricting the number of downloads of a file on my
> server?
Something like this could be triggered every time and then you can do
whatever you want once it hits 150... maybe have it send you an email
notification or something...
http://www.stevedawson.com/article0007.php
-
> I was wondering if there was any way I can create an image from some text
> with php?
Something like this?
http://sgss.me/obsolete/experiments/phpfontimagegenerator2/usage.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> Does anyone have a source for a US State and City database?
This is a monster but seems to contain what you need: http://www.geonames.org/.
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> libxml_use_internal_errors(true);
> $this->xml = new SimpleXMLElement($this->htmlString);
Hi Gary,
I have code that looks like this:
libxml_use_internal_errors(true);
$xml = simplexml_load_string($val);
$errors = libxml_get_errors();
if ($errors)
do this
else
do that
which wo
> I wonder what the difference is between doing "new
> SimpleXMLElement" and calling simplexml_load_string which results in the
> libxml_use_internal_errors call being ineffective. Odd.
The documentation for "Dealing with XML errors" only mentions
simplexml_load_string() and this comment
http://c
> And yes, I'd rather use DOM, but I can't.
Could you use this: http://simplehtmldom.sourceforge.net/?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi folks,
I have an array that looks a little something like this:
Array ( [6] => 43.712608, -79.360092 [7] => 43.674088, -79.388557 [8]
=> 43.674088, -79.388557 [9] => 43.704666, -79.397873 [10] =>
43.674393, -79.372147 )
but after I pass it to a function, it loses it's indexing and becomes:
A
My bad, I had some leftover code running array_values() on it before
it got passed.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi everyone,
I've built a fairly large normalized database schema for a project.
This is fun for me as I like thinking about how everything is
interconnected. Foreign keys are all set up, many-to-many tables are
go, etc, and so on. But now it's time to create an interface between
that database
> i recommend propel
> http://www.propelorm.org/
This looks hopeful. I'd checked it out before but for some reason
lumped it in with all of the other half-baked tools that didn't do
what I wanted, but even that basic example seems to cover most of what
I want.
Thanks for the suggestions.
Marc
> i recommend propel
> http://www.propelorm.org/
Holy Moses that thing is a monster. It requires installing extra
libraries (Phing) in order to create an XML schema reverse-engineered
from my existing database. The code looks simple enough but that
installation is brutal. Any other suggestions?
> Let me repeat myself: did you have a look at Doctrine2?
Hi Peter,
I didn't mean to ignore your suggestion, I just got extremely
overwealmed by the Doctrine website and didn't even have a response.
I get the impression that, like Zend and others, learning how to
install and use that would take l
Hi folks,
I'm looking for a straightforward way to protect PHP files which are
called via AJAX from being called from outside my application.
Currently, someone could forseeably open the console and watch the
javascript post variables to a public file (actions/delete_thing.php)
and then use this k
Thanks everyone.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Does anyone know if the Snoopy class has been ported to use the
built-in PHP cURL library and released publicly somewhere?
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> Does anyone know if the Snoopy class has been ported to use the
> built-in PHP cURL library and released publicly somewhere?
I converted it myself. If anyone's interested the class is attached.
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/
> $response = print_r($_REQUEST, true);
> echo $response;
I'm sorry I don't have any input on your actual question but tohuhgt
I'd mention that this can be shortened to:
print_r($_REQUEST);
... if I'm not mistaken.
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
I would chalk this up to that fancy, extra-curly, apostrophe that you
get when copying and pasting text from Microsoft Word or similar.
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> function html($text)
> {
> return htmlentities($text, ENT_QUOTES, 'UTF-8');
> }
>
> function htmlout($text)
> {
> return html($text);
> }
Possibly irrelevant, and definitely not related to your questions, but
is it just me or is htmlout() a useless function? Why not just call
html
Can I make a facebook site using PHP? If yes, how?
Please send me the infos privately.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> Which was created by the code, but I apparently can't seem to echo it and
> get it to display like above.. It converts it to html no matter what I do.
Have you tried the HTML tag? (http://www.w3schools.com/TAGS/tag_pre.asp)
Putting inside a might also work for you...
--
> if steve's idea is something doable.. why don't you consider setting
> up the mysql data dir on some removable media (thumb/flash drive)?
It seems to me that almost no matter what method you choose, you're
going to have to ask the client to do something manually - whether
that's logging out of t
> if(file_exists('boss_man_say_okay') ){ // let monkeys work }
Is there an acronym for the sound of sad, knowing laughter?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
What sort of results do you get with
echo "
Page Title
This is the page body
";
or similar?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
if(1 == 1){
echo 'here';
}
elseif(1 == 1){
echo 'here"';
}
Will only echo "here" once.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I use this: http://code.google.com/p/php-csv-parser/
No idea if it's any better than your current solution. I presume
you've tried extending PHP's memory limit?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
A simple AJAX script would do the trick, no? Or does the script which
was triggered by JS get aborted if that page is unloaded?
If javascript is unavailable you could trigger it through the tag like so:
Again, not sure if it will keep running if the caller is unloaded.
--
PHP General Mailin
Toilet seat. Up or down. Same thing? Sort of.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi folks,
I've got a problem with character encoding that's threatening to kill
my little brain. Here we go:
I have a directory with a bunch of PDFs in it that my webpage displays
links to. All of the files have the french character  in them. The
operating system is Linux (I did not experience
> Are you using UTF-8?
Could you be more specific? Do you mean in the browser/php header or
in the filesystem? I created the file on a Windows machine,
transferred them to a Linux machine, and the encoding of the page is
UTF-8.
I just noticed a strange thing which might shed some light. If I j
> If I am understanding correctly, you are referring to a HTML specific issue
> where the HTML and browser configuration is displaying your characters
> improperly?
No, the browser is displaying the characters of the filename fine
(using htmlentities converts the ? unknown character into an Â.
Again, if it helps, a link formatted in the same way to the same file
links correctly on a windows machine.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> A windows server, or windows client to the same Linux server? I believe that
> this issue is starting to get a bit over my head, with the different
> operating systems involved and such.
Windows server. This is over my head, too. I'm guessing that Windows
and Linux encode filenames different
> Have you tried using the utf8 meta tag rather than using the htmlentities()
> function? That should solve the first issue, as I reckon the problem lies
> with the way your encoding the filename.
The page is being encoded in UTF-8. Without htmlentities() the
special character is displayed as a b
> I think one way to do this is something like this (untested):
This is a good idea, but I'm stubborn and believe it can be solved
without adding more code. Thanks, though, I'll probably end up using
it once I've ruined every other possibility.
Marc
--
PHP General Mailing List (http://www.php.
> Where is the filename coming from? Is it hard-coded in the script or is your
> script reading it from a directory listing?
The filename is being read from the file via scandir(). File created
on Windows, transferred to *nix.
> Have you checked to see if that filename is what you think it is on
> You say that in putty it is converted to a '?'? so, on linux, the file
> name is no longer what you intended it to be, so wouldn't you then need
> to call the file EXACTLY as it is on the linux server?
I thought this too at first, but if I run htmlentites() on the
filename it displays the  cha
> Have you tried using the utf8 meta tag rather than using the htmlentities()
> function? That should solve the first issue, as I reckon the problem lies
> with the way your encoding the filename.
It seems that the filenames are ISO encoded as if I set the meta tag
to ISO and remove the htmlentiti
Hi folks,
I'm sure this is an easy one that's standing right in front of me but
I'm too blind to see. I have a page with an URL like this:
index.php?name=value&this=that. I have a link on the bottom of the
page which allows the user to switch languages. I need to hang onto
the existing $name and
> What's wrong with just putting the url parameters in the link that you know
> you need, one by one?
I have a footer that I include on every page and would like it to
adapt to whatever situation it finds itself in. Is your suggestion,
to do the following for the existing example:
echo "Flip";
My working solution was to put it in a form with a hidden input with
the correct name and value.
But I'm still wondering what your advice is regarding best practice.
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> Session_start();
> $_SESSION['language'] = "en";
> You can set the session variable to the current get or maintain the original
> passed.
I think you may have misunderstood. The problem is holding onto the
existing GET variables in the URL while manipulating or adding one of
them... and doing
> foreach($_GET as $k => $v) $qs[$k] = URLDecode($v);
> $qs['lang'] = 'en';
> echo 'Flip';
Hi Tamara,
Thanks for the tips. Do you see any advantage of this method over
using a small POST form besides the styling problems I'll run into
trying to make the submit button look like an achor?
Marc
-
> So all you need to do, is take a look at $_SERVER['HTTP_ACCEPT_LANGUAGE'] to
> get a users language preferences.
Hi Nathan,
Yep, I'm using this var to set the default but I think it's nice to
allow the user to override it. Maybe someone using their computer is
more comfortable in a different l
> A bit late in the thread. However, IMO, I don't think session is necessary,
> unless you intend to save it for later use, during that same visit from the
> user. If it's just a 1 time request, you can just use (example)
> $_GET['lang']=en,de,fr,...
> Then just split up individual languages, pro
> Nathan previously mention what if instead of a language specific request,
> you have request for multiple languages.
I get it now, multiple _simultaneous_ languages.
Cheers,
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> if(!$db = @pg_connect($connection_string)) {
> return FALSE;
> }
> return $db;
>
> how can I find the problem and fix it?
The @ symbol is telling it to ignore errors. Remove it and you'll see
them if that's where the problem is.
http://php.net/manual/en/lan
>>> >> var_dump($_POST);
>>> ?>
Where exactly are you putting this line?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
The function http_build_query() is turning your $_POST array into a
query string ($_GET), so the answer to this really depends where
you're trying to dump the array.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
This thread is a really good example of how difficult it can be to
both explain and understand a problem. The original poster might want
to restate the question from scratch with a more explicit and complete
example.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http:/
Woah. Is that good luck or bad luck?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Suspicion is my religion. Let no thread end without a war.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Is there a reason for you not to build a contact form?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I've used both Netbeans and Aptana w/ WinXP over the past few years
and of the two I would recommend Aptana. Netbeans was crippling slow
and Aptana often gets it's workspace corrupted, which makes both of
them crappy (yet free!), but for day to day use when they're not
failing entirely, Aptana is
Everyone switched to PCP?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> You mean everyone finally RTFM?
There's a manual? GoDaddy told me to just ask all of my questions here!
(No insult meant, in case it's not obvious.)
Happy Fridays
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> Notice: Use of undefined constant QUERY_STRING - assumed 'QUERY_STRING' in
I would guess that it's asking you to add quotes around QUERY_STRING...?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi folks,
I'm trying to compare two strings in order to determine whether or not
the site is just switching languages on the same page or whether the
link is pointing to an entirely different page. Things were fine
until I realized I was getting false positives for subpages, where the
URLs matche
Answered it myself (funny how writing out a problem as descriptively
as possible makes the brain work better).
$end_of_url = substr("http://domain.com/about/page/subpage/";,
strlen("/about/page/") * -1);
$same_post = ($end_of_url == "/about/page/");
--
PHP General Mailing List (http://www.php.ne
I'll do it, but only if it's on "paid on delivery" and/or subsidized
by African royalty.
Are our comments still welcome?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Use Magento. It will take you more than 6 months to build what you're
talking about all by yourself. Magento is a pain to learn at first
but once you get into it things start to make sense and development
speeds up.
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
> First, did the original poster realize that he was assigning a value to the
> variable $a in the 'if' statement?
Hello,
Yes, I did, and if you read my responses you can see that I came to
the realisations you describe. I don't think that anyone suggested
there was a bug.
> $a is true (ie it
Hi Tedd,
A little searching enlightened me to the fact that in other languages,
a single | or & operator will cancel the short-circuiting so all of
the evaluations are done before proceeding. However, they don't seem
to exist in PHP so in your example it behaves the same as ||...?
http://php.net
/language.operators.bitwise.php
-- Forwarded message --
From: Volmar Machado
Date: 3 January 2013 12:42
Subject: Re: [PHP] Boolean type forced on string assignment inside if statement
To: Marc Guay
My results in a simple test:
'); //1
echo ('($a || $b))' . ($a || $b) . '
And the answer is that it's a locale issue...
http://stackoverflow.com/questions/7931853/why-does-phps-iconv-need-setlocale
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> This is my first time using a list. Can anyone confirm I'm doing this
> correctly?
N! You broke it!
Happy Friday,
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> Have you tried keeping all of your documents in one directory and blocking
> that directory via a robots.txt file?
These don't sound like robots that would respect a txt file to me.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> correlate various types of information, which is very hard. For a human,
> this is very simple. It's simple, and very friendly to your guests.
Assuming humans will continue to behave as I've seen them behave so
far, even this "simple" system will guarantee you angry emails from
people who'll wan
Does anyone else find it strange that the movie Troll only has 2 stars
on IMDB? I think it's worth at least CAPSLOCK.
On 29 May 2013 11:45, Tommy Pham wrote:
> On Wed, May 29, 2013 at 9:30 AM, Stuart Dallas wrote:
>
>> On 29 May 2013, at 17:26, Last Hacker Always onpoint <
>> lasthack...@gmail
Is the "echo $mySQL_user;" inside of a function? I believe you'll
need to say "global $mySQL_user;" to gain access to it if so.
On 29 May 2013 12:39, Ron Piggott wrote:
>
> Good morning all:
>
> I have recently purchased a computer and am using it as a dedicated server.
> A friend helped me i
http://www.answershat.com/questions/352/How-to-get-rid-of-spam-mail-in-my-mailbox
On 14 June 2013 09:28, Chirag Vekariya wrote:
> Hi,
> Post your question to http://answershat.com
>
> On Thu, Jun 13, 2013 at 4:49 AM, dealTek wrote:
>
>> Hi all,
>>
>> I'm curious of a simple, common, universal wa
$('.lightbox-image-class').click(function(){
$.post('ajax.php', {click: true});
});
and do your DB work in ajax.php
http://api.jquery.com/jQuery.post/
On 14 June 2013 09:52, Tedd Sperling wrote:
> Hi gang:
>
> It's Friday so I am allowed to ask odd questions.
>
> Here's the problem -- I ne
Also, the docs and functionality for that particular plugin seem a bit
weak. Maybe there's another one that has a "doneLoadingLightbox"
event that you could hook into and call your ajax script inside of...
On 14 June 2013 10:02, Marc Guay wrote:
> $('.lightbox-image
Never used it but searching turned up
http://php.net/manual/en/function.chdir.php
Marc
On 20 June 2013 12:57, Tedd Sperling wrote:
> On Jun 20, 2013, at 1:44 PM, Bastien wrote:
>>
>> It sounds like a current working directory issue. Try running a getcwd() in
>> both places to see how they are
Those Belgacom emails were the only thing keeping me from a crushing
loneliness - undo!
On 16 August 2013 11:51, Matijn Woudt wrote:
> On Fri, Aug 16, 2013 at 5:23 PM, Daniel Brown wrote:
>
>> # ezmlm-list ~ezmlm/php-general | grep skynet
>> supp...@skynet.be
>>
>> # ezmlm-unsub ~ezmlm/php-gene
Here are two references from the Wikipedia article on Java in case you
haven't looked at them already.
http://www.langpop.com/
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
On 20 August 2013 10:43, Tedd Sperling wrote:
> On Aug 20, 2013, at 10:36 AM, "Liam" wrote:
>> You do r
> Thanks Sorin, I will do that and I will have more care the next time.
You have no reason to apologize. You shared a project you made by
yourself, way to go.
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
If you have the technology handy, it could also just be easier to wipe
the children's memories after each stay.
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> I'm looking forward to the day that I'll know everything and can stop all
> this learning nonsense.
Sounds like the attitude most people take when they sit down to a
keyboard. (Ref: http://xkcd.com/386/)
Off-topic is the new on-topic
Marc
--
PHP General Mailing List (http://www.php.net/)
T
Give parse_str() a go.
http://ca.php.net/manual/en/function.parse-str.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> There can be nothing more simpler than this!!!
I thought that this quote needed some revisiting.
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> Imagine when there'll be the day when you do not have to code at
> all...just copy 'n paste snippets together in the order that you wish
> them to work in and Voila'! - instant web app.
I have a Wordpress plugin that will do all of that for you.
--
PHP General Mailing List (http://www.php.net/
> In fact I'm wondering why the OP doesn't just do what every other site
> seems to do - accept the registering user's input as valid, and ask them
> to validate it by sending them an email address to that address.
It still makes sense to validate the format of the address as soon as
possible. Th
> 1.) Saving strings to a database
One thing I always forget to remember is to send tge "SET NAMES utf8"
command to MySQL after making a connection. This will save you 1000
headaches if you're working with non-latin characters. I can't count
the number of times I've thrown htmlentities, htmlspec
> I'm looking for a faster way to count online users. COUNT(*) is time
> consuming under MySQL.
If COUNTing is the heavy part, why not create a 'users_logged_in'
field somewhere and increment it when someone logs in and decrement it
when someone logs out? Then your query is just a straight SELEC
It's an interesting idea (a different take on coding best practices)
but I find the PHP example to be laborious and time consuming with
little benefit. If I'm typing an IF statement, I hope to god I know
what the condition is before I start typing it. Creating the if/else
structure first and then
This question will probably reveal my lacking knowledge of the
fundamentals, but I'm a go for it anyway:
When you use a $_SERVER variable, is a query made to the server to get
the information or is it just sitting in a variable all ready to go?
Reworded, is there any efficiency gained by storing t
> $_SERVER is just a prepopulated superglobal array that is created at
> runtime.
Thanks for the clear answer.
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> so when
> you're using $_SERVER variables there's no call back to the server, as the
> code is still being run on the server at that point.
This is something I actually do understand. I was wondering if the
code running on the server had to query the server for the information
every time a $_S
> This is called globally in *all* my scripts. In another script I'd
> really like to set the session to expire after the browser closes if a
> uses clicks "public terminal" or something.
Howdy. Don't sessions expire when the browser closes as a rule? Do
you mean the session cookie? Why not sto
I think that my suggestion is still a valid solution, someone correct
me if I'm wrong. Let's say your code went like this:
session_start();
// Check to see if the session variable has already been set, if not
if (!isset($_SESSION['var'])){
// Check to see if it's been stored in a cooki
> The statement should be at the start of every php file that has php code in
> it.
Hi Tedd,
Normally I'd agree with this but having never used the function
session_set_cookie_params() before, I looked it up, and the manual
says to put it before session_start().
"Set cookie parameters defined i
Hi folks,
I've stumbled into a project involving a server running PHP4 without
cURL. The script fetches data from an XML webservice and deals with
it. Is http://ca2.php.net/xml_parser_create the place to start? Any
tips (besides updating PHP)?
Here's an example of the PHP5 code:
$url = "http:
Hi Richard,
It's not a SOAP service, and I've actually decided to have ask the
client to upgrade their server software before continuing. But for
the sake of study:
> Depending upon your requirement, you could use simplexml_load_string() to
> convert an XML string into a native PHP object rath
Hi Scott,
I'm glad you resolved your problem. I'm curious about your method
though, as it seems to be an entirely different approach to my own.
How do you refer to your session data throughout the rest of the site?
Do you always reference the $_COOKIE variables or do you utilise
$_SESSION's at s
> The ease I had in running multiple versions of PHP on Windows would
> suggest it should be pretty easy to do for non-windows.
Funny and true. Thanks for the tips Richard, I've suggested that they
upgrade their hosting package.
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubsc
> Here's what I need to do: I have an indexed array, from which I need to
> delete elements in the middle. Once completed, the indexes should be
> numerically in sequence, as they were when I first encountered the
> array.
I believe that array_values() will do the trick.
Marc
--
PHP General Mai
> I've given a simplified example. The actual target array is
> multi-dimensional.
Your questioni sn't entirely clear but there's lot of chatter about
multidimensional arrays on the array_values() page that might provide
a solution.
--
PHP General Mailing List (http://www.php.net/)
To unsubscrib
Quick googling came up with this:
http://www.yournewdesigner.com/css-experiments/javascript-window-close-firefox.html
Maybe try the JS mailing list if that doesn't take you down the right
road. PHP can't manipulate the browser.
Marc
--
PHP General Mailing List (http://www.php.net/)
To unsubsc
1 - 100 of 178 matches
Mail list logo