Re: [PHP] How to capture uploaded file data

2013-09-28 Thread Bastien


Thanks,

Bastien

 On Sep 27, 2013, at 12:56 AM, Mariusz Drozdowski scheme...@wp.pl wrote:
 
 Hi all php experts,
 
 I would like to ask you all a question, I hope this is the right place
 to ask it.
 
 I'm writing a PHP extension now in c/c++. User uploads a file (could be POST
 or PUT method, but I can limit it to POST only). I need to capture the
 file data while being
 uploaded, without writing it to disk on the server. I need to process
 the data and (maybe,
 depending on a situation) send it somewhere else or save it to disk.
 Of course I know, that I can process the file
 after it has been uploaded (saved on disk on the server), but I would
 like to avoid it.
 I also need to do something opposite: I need to generate a file on the
 fly and send it
 to the user. All metadata of the generated file is known beforehand
 (e.g. size, name).
 
 I've been searching around for some time now and I could not find
 anything even close to the solution.
 Is there any example(s) or existing PHP extension that do(es) something
 like this (at least something simmilar) ?
 If you could give me any pointers that would be awesome.
 
 Thanks for your help 

The question I have is why? Should your upload fail for any reason you've got a 
half processed file that is non-recoverable.  No do-overs. If you stick to the 
standard processes with out the extension,

Upload
Save somewhere (or leave in temp upload folder)
Process
Send result back to user 
Unlink file

Generating the file and sending it to the user is also pretty standard

Create your dataset
Send appropriate headers
Send data
Close connection

For this, there usually isn't a need to save the file. You may run into issues 
streaming the data to certain browsers. 

Also one of the main downsides to your upload is high load situations or large 
file situations (where file size exceeds php's upload limit). 

My personal preference is to save that file to disk so that if needed I can 
work with it later ( if say the server load is high) and email the results to 
the user. 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] create a local temp table in local machine

2013-09-28 Thread Bastien


Thanks,

Bastien

 On Sep 28, 2013, at 3:24 PM, iccsi inu...@gmail.com wrote:
 
 I need create a local table on the local machine.
 I would like to know is it possible to down on server side or client side or 
 jQuery to do the work.
 Your information and help is great appreciated,
 
 regards,
 
 
 Iccsi

If you're looking to create a SQl table then most but not all browsers can use 
SQLite locally for data storage ( it does require newer browsers). 

You haven't stated the goal for this so other options could include sending csv 
or json data down to the browser and using jquery, angular or some other JS 
framework to manipulate that data may also be an option



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] create a local temp table in local machine

2013-09-28 Thread Bastien


 On Sep 28, 2013, at 6:00 PM, iccsi inu...@gmail.com wrote:
 
 Thanks for the message and help,
 because I use jQuery autocomplete which has performance issue for thousands 
 records due to network load data.
 I want to load the data to local table to resolve performance issue, if it 
 possible I can load to an array in the memory.
 
 Thanks again for helping,
 
 Regards,
 
 iccsi,
 
 Bastien  wrote in message 
 news:2fd3037d-f68d-47b3-ac4f-007d9559d...@gmail.com...
 
 
 
 Thanks,
 
 Bastien
 
 On Sep 28, 2013, at 3:24 PM, iccsi inu...@gmail.com wrote:
 
 I need create a local table on the local machine.
 I would like to know is it possible to down on server side or client side or 
 jQuery to do the work.
 Your information and help is great appreciated,
 
 regards,
 
 
 Iccsi
 
 If you're looking to create a SQl table then most but not all browsers can 
 use SQLite locally for data storage ( it does require newer browsers).
 
 You haven't stated the goal for this so other options could include sending 
 csv or json data down to the browser and using jquery, angular or some other 
 JS framework to manipulate that data may also be an option
 

I had exactly this situation, large list with the autocomplete. I cached the 
list to a JS file and ran the autocomplete from that. It works well if the list 
is relatively static which mine was. It will be tougher if the list is dynamic, 
but you could send the data down after the initial page load. 

HTH

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] create a local temp table in local machine

2013-09-28 Thread Bastien


Thanks,

Bastien

 On Sep 28, 2013, at 8:24 PM, iccsi inu...@gmail.com wrote:
 
 Thanks for the information and help,
 Yes, my data is pretty much static,
 Can you please give me some link for the solution?
 It is the solution I am looking for my current situation,
 
 Thanks a million for helping,
 
 Regards,
 
 Iccsi,

I don't have a link unfortunately. The system I did it for is proprietary. But 
I do recall it was a pretty switch in the JS to view the list from the static 
file. The JS file with the static data was just an array and the autocomplete 
looked at that as the data source

Sorry

Bastien

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Friday's Question

2013-09-20 Thread Bastien


Thanks,

Bastien

 On Sep 20, 2013, at 12:51 PM, Tedd Sperling t...@sperling.com wrote:
 
 Hi gang:
 
 Do you use a Mousepad?
 
 My reason for asking is that I've used a Mousepad ever since mice first came 
 out (back when they had one ball).
 
 Now that mice are optical (no balls), Mousepads are not really needed -- or 
 so I'll told by the college -- you see, they don't provide Mousepads for 
 their student's computers.
 
 As such, I wondered what's the percentage of programmers still using a 
 Mousepad?
 
 Secondly, are Mousepads used primarily by older programmers (like me) while 
 younger programmers don't use Mousepads, or what?
 
 So -- please respond with:
 
 Age: *
 Mousepad: Yes/No
 
 Thank you,
 
 tedd
 
 PS: * If you don't want to provide your actual age, then indicate your age by 
 stating young, middle-age, old-age, ancient, or whatever term 
 describes your age.
 
 Alternate -- I claim that you can tell a man's age by ten-times the number of 
 personal products he routinely uses, for example:
 
 Years Old- Personal Products
 10Toothpaste
 20Toothpaste, Deodorant
 30Toothpaste, Deodorant, Aftershave
 40Toothpaste, Deodorant, Aftershave, Minoxidil
 50Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H
 60Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb
 70Toothpaste, Deodorant, Aftershave, Minoxidil, Preparation-H, Bag Bomb, 
 Fixodent
 
 So, you could indicate age by stating Bag Bomb like me.
 
 ___
 tedd 

Every time I see something about mice, i always remember this article from IBM 
on how to care for your mouse. Best technical doc ever!

http://www.snopes.com/humor/business/mouse.asp

But in any case, 43

Use a mouse: yes mousepad occasionally depending on table surface 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Apache's PHP handlers

2013-09-19 Thread Bastien Koert
On Thursday, September 19, 2013, Stuart Dallas wrote:

 On 19 Sep 2013, at 14:39, Aziz Saleh azizsa...@gmail.com javascript:;
 wrote:

  The best way to handle file uploads is to:
 
  1) Store the filename somewhere in the DB, rename the file to a random
 string without extension and store the mapping in the DB as well.
  2) When sending the file, set the header content to the filename and
 output the content of the file via PHP (ex: by readfile).
 
  Aziz
 
  This way even if the file is PHP code, it will be of no issue to you.

 What you describe it highly inefficient, clunky, and unnecessary. You've
 managed to get PHP and a database involved in serving a static file, for no
 reason other than to avoid fixing the web server configuration.

 A misconfigured web server should be fixed, not worked around.

 -Stuart

 --
 Stuart Dallas
 3ft9 Ltd
 http://3ft9.com/
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


You can also run a strip_tags() call on the file upload to help prevent this

Bastien


-- 

Bastien

Cat, the other other white meat


Re: [PHP] PHP Dependency Injector

2013-09-05 Thread Bastien Koert
Jee, that should have been a friday comment...how does your dic standout


On Thu, Sep 5, 2013 at 4:06 PM, Sorin Badea sorin.bade...@gmail.com wrote:

 There are few tutorials about home made dic. How does your dic stand out
 from the crowd ?

 Regards.

 On Thu, Sep 5, 2013 at 10:56 PM, Juan Sebastian Scatularo 
 sebastianscatul...@gmail.com wrote:

  Hello people, I want to share with you a simple and small Dependency
  Injector made for me.
 
  https://github.com/abloos/Sofia
 
  Regards
 
  --
  Facebook: www.facebook.com/JuanSebastianScatularo
  Twitter: www.twitter.com/js_scatularo
  Web: www.sebastianscatularo.com.ar
 



 --
 Sorin Badea - Software Engineer




-- 

Bastien

Cat, the other other white meat


Re: [PHP] PHP vs JAVA

2013-08-20 Thread Bastien Koert
I think the big takeaway there is that JAVA is one of the primary language
for larger companies and applications. Start ups tend to use smaller easier
to use tools like php / javascript / python / ruby.

I saw one figure recently that put php at 75% of websites out there (i
think that came out when google decided to support php for the app engine)



On Tue, Aug 20, 2013 at 10:19 AM, Tedd Sperling t...@sperling.com wrote:

 On Aug 20, 2013, at 10:04 AM, Ashley Sheridan a...@ashleysheridan.co.uk
 wrote:
  Is he possibly getting confused with Javascript?
 
  Thanks,
  Ash

 No, this guy is smarter than that -- he's pretty sharp -- so I listen to
 what he has to say.

 Here's an interesting link:

 http://www.sitepoint.com/best-programming-language-of-2013/

 But the link does not divide languages between Web and Other -- other than
 Android Java, which I do not believe is also included in the above Java
 number.

 I think there is more going on here than what I know.

 For example, my college has numerous (over 3) JAVA classes filled to the
 max, whereas my PHP class was canceled due to lack of students. Granted the
 college could have advertised my PHP class more, but still there is an
 overwhelming demand for Java Programmers. My questions is Why?

 Cheers,


 tedd

 ___
 tedd sperling
 t...@sperling.com






 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 

Bastien

Cat, the other other white meat


Re: [PHP] Output to File Instead of Browser

2013-08-20 Thread Bastien


On 2013-08-20, at 12:38 PM, Floyd Resler fres...@adex-intl.com wrote:

 I have a php file that generates a form.  Of course, this displays in the 
 browser.  How can I have the form generated from my script but either saved 
 to a file or the output returned to another script?
 
 Thanks!
 Floyd
 

I guess it depends on how your code is structured. I have older coder where the 
HTML is all one string so a file_put_contents($html, $filename); works simply. 



Bastien Koert
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Split/Group date together.

2013-07-18 Thread Bastien Koert
Normally, what I do here is handle that in the loop to display the records
... so start by adding an order by clause to keep the dates together

SELECT * FROM transportdokument WHERE dato = '16/7/2013' AND dato
= '18/7/2013' order by dato

$prior_date = ;

$sHTML = table;

while($rows = mysql_fetch_array($result)){

if ($prior_date != $rows['dato']){
if($open_table){
   $sHTML .= /tabletable;
   $prior_date = $rows['dato'];
 }
}
$sHTML .= tr;
$sHTML .= td. $rows['dato'] . /td;
$sHTML .= td. $rows['some_field'] . /td;
$sHTML .= td. $rows['another_field'] . /td;
$sHTML .= td. $rows['third_field'] . /td;
$sHTML .= /tr;
}

$sHTML .= /table;


On Thu, Jul 18, 2013 at 9:43 AM, Karl-Arne Gjersøyen karlar...@gmail.comwrote:

 Hello again.
 In my program I have this:

 mysql SELECT * FROM transportdokument WHERE dato = '16/7/2013' AND dato
 = '18/7/2013';

 This list all reccrds for 3 days. I need a way to split it up for every day
 even when the requst is as above and don't know in what way I can do it.

 I like to have all records for day 16 in one table in PHP/HTML and all
 records for day 17 in another table.
 i.e, Day 16 have 5 rows and day 17th and 18th have 7 and 8 rows.

 I hope for your help and advice to do also this correct.

 Thank you for your time and effort!

 Karl




-- 

Bastien

Cat, the other other white meat


Re: [PHP] Query regarding temporarily-uploaded files

2013-07-10 Thread Bastien


Bastien Koert

On 2013-07-10, at 3:29 PM, Anthony Wlodarski ant92...@gmail.com wrote:

 Is there anything that would prevent you from somehow uniquely knowing who
 the user is uploading the file. For example you mentioned client'.  If you
 know
 who the client is you can append that to the filename or prepend it, for the
 destination string (second parameter to the function call).  That way it is
 unique
 to that client.
 
 -Anthony

Another option is that you name the files yourself. Numerically for example and 
then just switch it back to the uploaded file name when either displaying it or 
sending it back to the user. 

You should also place all files outside the web root so it's harder to execute 
bad files. And prolly filter for files types. Allow only images ( png jpg gif ) 
for example

Bastien 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] A Strange Problem

2013-06-20 Thread Bastien

On 2013-06-20, at 1:39 PM, Tedd Sperling t...@sperling.com wrote:

 Hi gang:
 
 I have a very strange problem.
 
 I can use this statement in one folder:
 
$fcontents = file('docs/admin-email.txt');
 
 But in a different folder with an exact path having 'docs/admin-email.txt', I 
 get:
 
 Warning: file(/docs/admin-email.txt) [function.file]: failed to open stream: 
 No such file or directory in cut on line 83
 
 This has got me really puzzled.
 
 I have confirmed these are the exact same folders and files, except only in 
 two different places on the server. Both are one level down from root.
 
 Any ideas as to what is going on?
 
 Cheers,
 
 tedd

It sounds like a current working directory issue. Try running a getcwd() in 
both places to see how they are set

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] A Strange Problem

2013-06-20 Thread Bastien


Bastien Koert

On 2013-06-20, at 1:57 PM, Tedd Sperling t...@sperling.com wrote:

 On Jun 20, 2013, at 1:44 PM, Bastien phps...@gmail.com wrote:
 
 It sounds like a current working directory issue. Try running a getcwd() in 
 both places to see how they are set
 
 Bastien
 
 I think you have something, here's the reports:
 
 Works:
 
/home/content/64/cut/html/sdi/tedd/php-mail
 
 Does NOT work:
 
/home/content/64/cut/html/sdi
 
 The one that does not work should be:
 
   /home/content/64/cut/html/sdi/includes/
 
 How do I fix it?
 
 Cheers,
 
 tedd
 
 PS: All cut's were identical.
 
 
 _
 t...@sperling.com
 http://sperling.com

Chdir() could work. 

The interesting thing is to see why the two calls start in diff directories.

Thanks ,

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] A Strange Problem

2013-06-20 Thread Bastien


Bastien Koert

On 2013-06-20, at 2:14 PM, Tedd Sperling tedd.sperl...@gmail.com wrote:

 Bastien:
 
 You were right on - by changing the directory to what I needed, everything 
 works.
 
 My follow-up question is Why?
 
 I have *never* had to specifically tell any script to chdir() -- why with 
 that one?
 
 Cheers and Thanks!
 
 tedd
 
 
 _
 tedd.sperl...@gmail.com
 http://sperling.com
 

The calls from the code are occurring in diff dirs as the starting point. Is 
the call in an include file?

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] LightBox click detection

2013-06-15 Thread Bastien
Sorry 'bout the top post.

That's how I do it. Capture the click event with jquery and Ajax that back to 
the server

Bastien Koert

On 2013-06-15, at 2:07 PM, Tamara Temple tamouse.li...@gmail.com wrote:

 Tedd Sperling t...@sperling.com wrote:
 It's Friday so I am allowed to ask odd questions.
 
 W00T! Friday!
 
 Here's the problem --  I need to count the number of times a user activates 
 a LightBox -- how do you do that?
 
 Here's a LightBox Example:
 
   http://www.webbytedd.com/c2/lightbox/
 
 All the javascript is there (jQuery et al).
 
 Ideally, I would like to have a php/javascript combination that would:
 
 1. Detect when a user clicked the LightBox;
 2. Pass that value to PHP so I can keep count.
 
 Any ideas?
 
 First off, do you have the javascript code available in an unsquished
 form? That would mean I could read it.
 
 Not knowing whether your JS code or Lightbox has any hooks that you can
 take advantage of, I'd steal the onclick event from those images that
 start lightbox, fire off an AJAX request and ignore the return, then
 fire the lightbox event handler.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Using Table prefixes

2013-06-08 Thread Bastien


Bastien Koert

On 2013-06-08, at 5:58 PM, Tamara Temple tamouse.li...@gmail.com wrote:

 Julian Wanke jswp...@gmx.at wrote:
 A database for each client? Isn't that over-powered? If you have 1000
 clients, you would loose the overview over your databases...
 
 I believe what is being talked about is one DB per application install --
 'client' can be a way-overloaded term.


Some projects or apps require one db per client. But it does become a pain to 
manage. 


Bastien

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Using Table prefixes

2013-06-08 Thread Bastien


Bastien Koert

On 2013-06-08, at 5:56 PM, Tamara Temple tamouse.li...@gmail.com wrote:

 Tedd Sperling tedd.sperl...@gmail.com wrote:
 On Jun 8, 2013, at 3:00 PM, Ashley Sheridan a...@ashleysheridan.co.uk 
 wrote:
 dealTek deal...@gmail.com wrote:
 
 I can see the basic need for a table prefix in a case where you may use
 one mysql database for several projects at once so as to distinguish
 tables per project like...
 
 -snip-
 however I was told a long time ago to use a prefix tbl_ like
 tbl_Mytable but I don't really see much need for this by itself ... Am
 I missing something?
 
 I think that's a pattern that people use to distinguish their tables from 
 views, etc, but personally I find it a little pointless. It doesn't really 
 help in any way, and just means more typing.
 
 Using a prefix for a set of tables in one db where you might have several 
 things using the db (i.e. some hosting limits the databases you can have) 
 makes sense, and especially so if you name it sensibly as in your first 
 example. 
 Thanks,
 Ash
 
 I agree, but more than that I also set up databases specifically for clients 
 such that all the tables in them are related to the client and not each 
 other, such as:
 
 client1_db
 
 contacts
 invoices
 etc
 
 and
 
 client2_db
 
 contacts
 invoices
 etc
 
 As such, the tbl_ prefix is not needed.
 
 Cheers,
 
 tedd
 
 _
 tedd.sperl...@gmail.com
 http://sperling.com
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 In a multi-client situation like Tedd describes, it is rather more
 important to segregate client's data, otherwise you need to do a fair
 bit of permissions management to keep rogue employees/contractors at the
 various clients from snooping around. (It happens!)
 
 OTOH, when it's your own apps, and you are db restricted as Ash
 mentions, the table prefix thing can be useful. Personally, I don't do
 that, but that's because I am rarely resource-bound in that way. One db
 per app, basically.
 

I have run into situations where I prefix with the app name due to same table 
names in the same db. This was on a large db2 install. 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Looking for a good working PDO and/or mysqli database class to get started with OOP

2013-05-30 Thread Bastien


Bastien Koert

On 2013-05-30, at 10:30 PM, tamouse mailing lists tamouse.li...@gmail.com 
wrote:

 On Thu, May 30, 2013 at 8:45 PM, Stephen stephe...@rogers.com wrote:
 On 13-05-30 09:36 PM, dealTek wrote:
 
 Hi all, Thanks for your help...
 
 I'm looking for a very good, pre made, working PDO and/or mysqli database
 class (in a wrapper) - to get started with, that has all the basic needs
 like UPDATE - INSERT - DELETE - QUERY etc. That would be very helpful. I'm
 also trying to learn OOP, and creating my own class to start out is over my
 head, so one that is recommended here would be a good start.
 Hmmm.  PDO   **IS** an OOP implementation. Why would you want to
 encapsulate it?
 
 Accessing a database requires SQL with arguments dependant on YOUR database
 schema.
 
 You have to do that work; there is no way around it.
 
 Sounds like the OP is asking for a pre-built CRUD interface that
 adapts to his tables and their relationships. It's a fair question,
 just one I don't have an answer to. There must be some kind of ORM for
 PHP?

Propel? Eloquent? Doctrine?

And others ...

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] REQUEST

2013-05-29 Thread Bastien


Bastien Koert

On 2013-05-29, at 12:30 PM, Stuart Dallas stu...@3ft9.com wrote:

 On 29 May 2013, at 17:26, Last Hacker Always onpoint lasthack...@gmail.com 
 wrote:
 
 HEY GUYZ I KNOW, I KNOW THIS IS NOT A PLACE FOR SOMETHING LIKE THIS SO BUT
 HEY I HAVE A LITTLE TINY QUESTION FOR MY COOL GUYZ.
 
 DOES ANYONE HERE USE A SIMPLY MACHINE FUNCTION SCRIPT? BECAUSE THE
 SCRIPTINGS ARE A LITTLE HARD FOR ME TO UNDERSTAND PLEASE LET ME KNOW GUYS I
 WANT SOMEONE TO TEACH ME.
 
 1) Shouting at us will not encourage a helpful attitude.
 
 2) Neither will calling us your cool guyz.
 
 3) What is a simply machine function script?
 
 If you want someone to teach you PHP you'll probably need to pony up some 
 cash. If you want someone to help you while you're learning, show us that 
 you're working on it and we'll be happy to help.
 

If I had to guess I think he means a simple state machine. There are examples 
out there but he needs to read them
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Symfony?

2013-05-20 Thread Bastien


Bastien Koert

On 2013-05-20, at 12:40 PM, Tedd Sperling t...@sperling.com wrote:

 Hi gang:
 
 Who uses Symfony?
 
 Cheers,
 
 tedd
 
 
 _
 

I do. It's not my preferred framework. It's very powerful, but very complex and 
has a ton of yaml config files for the app. The learning curve is steep. 

What's the question?

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] A Good OOP Tutorial/Read?

2013-05-16 Thread Bastien


Bastien Koert

On 2013-05-16, at 5:28 PM, Tedd Sperling tedd.sperl...@gmail.com wrote:

 -Dan:
 
 I teach this stuff and still don't fully understand the why/when for 
 interfaces.
 
 Even the guru's I talk with can't give me a good explanation as to what the 
 advantages are in using them. I've done a lot of experimenting and can't see 
 any advantage for them other than grouping different classes together and 
 creating a new data-tytpe.
 
 Other than that, from my perspective interfaces are mythicode.
 
 So, if you find a good reference, please let me know.
 
 Cheers,
 
 tedd
 
 
 _
 

Tedd,

The best argument I've seen for interfaces is to abstract calling classes to 
avoid binding to a particular framework. Phpmaster was where I saw that.

The idea was that by implementing an interface, the swapping out a framework 
was much simpler since the only code that needed to be written was more the 
interface adapter to the new framework

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] generate onfly PDF

2013-05-05 Thread Bastien




On 2013-05-05, at 8:10 AM, Rafnews raf.n...@gmail.com wrote:

 On 05.05.2013 07:45, tamouse mailing lists wrote:
 On Sat, May 4, 2013 at 3:31 PM, Rafnews raf.n...@gmail.com wrote:
 On 04.05.2013 23:05, Tedd Sperling wrote:
 On May 4, 2013, at 5:00 PM, Ashley Sheridan a...@ashleysheridan.co.uk
 wrote:
 Rafnews raf.n...@gmail.com wrote:
 Is there a solution to generate onfly PDF from HTML page, and from data
 user typed in form (let's say like a template) without using PECL ?
 i read that is hosting does not allow such extension, we can not
 generate PDF, so i would rather get a solution without such library.
 
 Moreover i'm searching a solution free and that i can supply with my
 web
 components.
 I created a component that should be able to generate PDF files quite
 often as service for user.
 Have a look at fpdf, its a class that doesn't need any special
 server-side support. Its basic, but is pretty good.
 
 Thanks,
 Ash
 Ash is right, here's an example I provide my students:
 
 http://rebel.lcc.edu/sperlt/citw185/examples/pdf/
 
 Everything is there.
 
 Cheers,
 
 tedd
 AFAIK fpdf needs zlib and gd extensions.
 gd extension is almost everywhere enabled as extension, however i'm not sur
 zlib is enabled on most of servers...
 
 What do you think about that ?
 I would think zlib is even more ubiquitous than gd; it's used all over
 the place.
 
 and what about TCPDF librairy ?
 have you already use it ?
 how are its performances ?
 
 

I've been using dompdf for years. Does a good representation of the HTML as PDF

Bastien

 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Newbie Question - Parse XML with PHP...

2013-04-21 Thread Bastien Koert
I have an app that gets passed in xml and use this code to read that data in

// We use php://input to get the raw $_POST results.
$xml_post = file_get_contents('php://input');

Maybe it will help

Bastien


On Sat, Apr 20, 2013 at 7:48 AM, shiplu shiplu@gmail.com wrote:

 
 
 
  Question: how do you use $mylist when the xml is not as a file but is
  returned on a web page?
 

 I assume  It returns as a string from page. Then use
 simplexml_load_string(). See
 http://php.net/manual/en/function.simplexml-load-string.php


 --
 Shiplu.Mokadd.im
 ImgSign.com | A dynamic signature machine
 Innovation distinguishes between follower and leader




-- 

Bastien

Cat, the other other white meat


Re: [PHP] Is there a PHP based authentication library?

2013-04-02 Thread Bastien
Check out 
http://philsturgeon.co.uk/blog/2011/09/ninjauth-social-integration-php from 
Phil sturgeon. 

Bastien Koert

On 2013-04-02, at 3:41 PM, Mark mark...@gmail.com wrote:

 Hi Andy,
 
 To be honest, that's also not what i'm looking for, but might be a
 good starting point to extend on. Depends on how you made it :) I cant
 promise that i'ill be working on it. I might be for some future
 project in my company but it might very well not happen as well.
 
 On Tue, Apr 2, 2013 at 2:08 AM, Andy McKenzie amckenz...@gmail.com wrote:
 I started building one at my last job, though it was part of a framework I
 was developing.  I knew I was going to need to authenticate against both
 LDAP and old-fashioned database username/md5-password columns.  (Ah, legacy
 user databases.)
 
 If it would be useful, I could dig out what I had and try to make it into a
 stand-alone set of functions, but I never got further than those two
 options.  Basically there was a script that took in a username and password
 from a web form, then looked at a config file to decide which set of the
 sub-functions to use.  For a DB, it checked to see if the username and
 hashed password matched a row in the database;  for LDAP, it did some
 re-encoding to handle the weird encrypt that our OpenLDAP server used, then
 ran through the process of checking to see if the user actually had that as
 their password.
 
 Like I said, let me know if anyone wants to see it... I'm unemployed right
 now, and a project to work on this week (or next... this week is kind of
 busy) might be a good thing.
 
 -Andy McKenzie
 
 
 On Mon, Apr 1, 2013 at 6:49 PM, Mark mark...@gmail.com wrote:
 
 On Tue, Apr 2, 2013 at 12:27 AM, Sorin Badea sorin.bade...@gmail.com
 wrote:
 Hi Mark,
 I think a simple Google search would be faster. Anyway, an unified way
 for
 3rd party authentication doesn't exist from my knowledge, but for Persona
 you could use the sample from mozilla github account
 https://github.com/mozilla/browserid-cookbook .
 
 Good luck,
 Sorin!
 
 
 On Tue, Apr 2, 2013 at 12:26 AM, Mark mark...@gmail.com wrote:
 
 Hi,
 
 I stumbled upon this payment library: http://ci-merchant.org/ which
 abstracts the different payment backends away and exposes a new easy
 to use interface for the app developer to use. Thus making it very
 easy to use different payment providers.
 
 I was wondering if something like that is also existing for
 authentication? For example, in authentication you have quite a few
 different ones:
 - Mozilla Persona
 - openid
 - facebook connect
 - google (openid?)
 - use/pass based authentication (a.k.a. the self made version that
 every dev begins with)
 - oauth
 - twitter connect
 - etc...
 
 Is there such a library in existence? I'm especially looking for one
 with mozilla persona implemented.
 
 Kind regards,
 Mark
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 --
 Badea Sorin (unu.sorin)
 sorin.bade...@gmail.com
 unu_so...@yahoo.com
 Pagina personala:
 http://badeasorin.com
 
 I couldn't find it on google thus i asked in the one place where - if
 it exists - people would probably know. I find it quite surprising
 that a library like this isn't in existence yet. I can imagine tons of
 sites would certainly benefit from having one generic interface to
 use.
 
 Anyway, thank you for your pointer and reply. If you (or anyone else)
 finds a lib for this, please don't hesitate to post it in here. :)
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


Re: [PHP] Re: Generating CRUD code for normalized db

2013-03-13 Thread Bastien Koert
On Wed, Mar 13, 2013 at 2:55 PM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:
 On Wed, 2013-03-13 at 19:24 +0100, Marco Behnke wrote:

 Am 13.03.13 12:57, schrieb Gary:
  ma...@behnke.biz wrote:
 
  Do us all a favor abnd stay away from open source if you do not honor
  the work
  us wannabes put into it.
  As I said before I wasn't aware you would feel that the cap fitted.
  If you do feel that, then perhaps instead of complaining at me for
  pointing it out, you would be better off employing that time increasing
  the quality of what you produce.
 
 So you said you tried Yii. But have you wasted some of your precious
 time trying out the extension that extends Yii in a way, that creating
 models and views with Gii get proper SELECT Boxes and stuff for
 relations? If I understood you correct, this is what you were looking for?



 At this point I don't think he's looking for an actual solution, but
 merely wants to moan about open source. OSS has flaws, of course, but
 even someone so narrow minded would have a hard time arguing in earnest
 that it suffered from too little choice and a lack of solutions to a
 problem.

 Thanks,
 Ash
 http://www.ashleysheridan.co.uk



Two minutes with google got me this:

http://www.codegravity.com/programming/orm-object-relational-mapping-frameworks-php

It seems that propel ( http://www.propelorm.org/ ) and CoughPHP (
http://coughphp.com/ ) both offer code generation

-- 

Bastien

Cat, the other other white meat

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] XML to Array

2013-03-12 Thread Bastien


Bastien Koert

On 2013-03-11, at 10:50 PM, Karl DeSaulniers k...@designdrumm.com wrote:

 
 On Mar 11, 2013, at 8:22 AM, Bastien Koert wrote:
 
 On Sun, Mar 10, 2013 at 6:28 PM, Karl DeSaulniers k...@designdrumm.com 
 wrote:
 
 On Mar 10, 2013, at 6:03 AM, richard gray wrote:
 
 On 10/03/2013 11:47, Karl DeSaulniers wrote:
 
 Hi Guys,
 I am hoping someone can guide me or help me fix this issue.
 I have been lost in the code for some time now.
 I am trying to get the attributes of an xml node.
 I have this code:
 [snip]
 
 this may help -
 http://stackoverflow.com/questions/1156957/php-xml-attribute-parsing
 
 I do admit I haven't the foggiest idea what I am doing here, so I am
 noobing out here on how this php function is really working.
 I got it off php.net and am trying to implement it in my code. Without my
 addition it works well except it doesn't grab any attributes
 which I need in order for my script to work properly.
 
 Any ideas on what I am doing wrong?
 
 TIA,
 
 
 HTH
 rich
 
 
 
 Thanks rich,
 That uses simpleXML. I am using xml_parse_create.
 Any ideas for xml_parse_create? I really like the way this function
 puts everything into an array that I can traverse. I only need it to put
 the attribute values in the array for the corresponding node and I am done.
 *Sigh
 
 Thanks for your help,
 
 Best,
 
 
 Karl DeSaulniers
 Design Drumm
 http://designdrumm.com
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 I came across this XML to JSON to an array some time ago. It might be 
 something
 
 function xmlToArray($xml)
 {
return json_decode(json_encode((array) simplexml_load_string($xml)),1);
 }
 
 -- 
 
 Bastien
 
 Cat, the other other white meat
 
 Actually no, I don't need the root node after all.
 Looks like it finally works! :)
 
 Thank you Bastien! Nice one-liner.
 
 Best,
 
 Karl DeSaulniers
 Design Drumm
 

Glad it works for you 
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] XML to Array

2013-03-11 Thread Bastien Koert
On Sun, Mar 10, 2013 at 6:28 PM, Karl DeSaulniers k...@designdrumm.com wrote:

 On Mar 10, 2013, at 6:03 AM, richard gray wrote:

 On 10/03/2013 11:47, Karl DeSaulniers wrote:

 Hi Guys,
 I am hoping someone can guide me or help me fix this issue.
 I have been lost in the code for some time now.
 I am trying to get the attributes of an xml node.
 I have this code:
 [snip]

 this may help -
 http://stackoverflow.com/questions/1156957/php-xml-attribute-parsing

 I do admit I haven't the foggiest idea what I am doing here, so I am
 noobing out here on how this php function is really working.
 I got it off php.net and am trying to implement it in my code. Without my
 addition it works well except it doesn't grab any attributes
 which I need in order for my script to work properly.

 Any ideas on what I am doing wrong?

 TIA,


 HTH
 rich



 Thanks rich,
 That uses simpleXML. I am using xml_parse_create.
 Any ideas for xml_parse_create? I really like the way this function
 puts everything into an array that I can traverse. I only need it to put
 the attribute values in the array for the corresponding node and I am done.
 *Sigh

 Thanks for your help,

 Best,


 Karl DeSaulniers
 Design Drumm
 http://designdrumm.com


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


I came across this XML to JSON to an array some time ago. It might be something

function xmlToArray($xml)
{
return json_decode(json_encode((array) simplexml_load_string($xml)),1);
}

-- 

Bastien

Cat, the other other white meat

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Newbie is trying to set up OOP With PHP and MySQL or MySQLi database class (using CRUD)

2013-02-14 Thread Bastien Koert
On Thu, Feb 14, 2013 at 1:24 PM, Haluk Karamete halukkaram...@gmail.com wrote:
 I recommend a third option, that is PDO.

 Start here please. http://net.tutsplus.com/?s=pdo

 On Thu, Feb 14, 2013 at 9:49 AM, dealTek deal...@gmail.com wrote:
 Hi everybody,

 Newbie is trying to set up OOP With PHP and MySQL or MySQLi database class 
 (using CRUD)

 Simple story: creating this class database by myself is way over my head. So 
 it be best for me to find something on the Internet that has already been 
 created and working to pro specs (using CRUD with good security etc).

 In my studying, it seems that there is a difference between MySQL and MySQLi 
 - MySQLi  being the preferred choice if I understand correctly.

 There are lots of examples on the Internet however I don't know enough about 
 it to know a good starting example from a bad starting example, so I would 
 much appreciate any assistance pointing me towards a good starting point

 This seems a good start to me untrained eye, but it seems to be for mysql - 
 not mysqli...

 http://net.tutsplus.com/tutorials/php/real-world-oop-with-php-and-mysql/

 http://www.dreamincode.net/forums/topic/223360-connect-to-your-database-using-oop-php5-with-mysql-and-mysqli/

 http://snipplr.com/view/8417/

 http://snipplr.com/view/12535/

 any assistance is appreciated!

 --
 Thanks,
 Dave - DealTek
 deal...@gmail.com
 [db-3]


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


The DreamInCode one is good. MySQLi is the recommended option over
MySQL since the mysql one is deprecated. PDO is also a great option
since you can prepare your queries to help sanitize the data

-- 

Bastien

Cat, the other other white meat

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Apache to serve RESTful requests using PHP

2013-02-09 Thread Bastien


Bastien Koert

On 2013-02-09, at 11:42 AM, AmirBehzad Eslami behzad.esl...@gmail.com wrote:

 Dear list,
 
 We're a developing a PHP-driven web service with a RESTful API,
 and we have a dedicated Linux server for that with 6GB of RAM.
 
 Since this service will be used by many clients in a concurrent
 manner,  we'll face with a high-load on our web-server.  But
 web-services are different from web pages, for instance they
 don't include images, or in this case we only serve JSON.
 
 I'm wondering what are the recommended configurations for
 the Apache web-server in these situations?  Should we disable
 keep-avlie?  What about other directives?  Apache is our
 bottleneck, and we're trying to optimize it. Should we use nginx instead?
 
 Please let me know your suggestions.
 
 Thank you,
 -behzad

How much of that data is cachable? You're likely to get bigger performance 
gains from caching frequent data.

Keep-alive at maybe 1 second. 

But would need to know more about the app to be able to suggest more

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] variable placeholders in a text file

2012-12-31 Thread Bastien


Bastien Koert

On 2012-12-31, at 4:58 PM, tamouse mailing lists tamouse.li...@gmail.com 
wrote:

 On Mon, Dec 31, 2012 at 2:37 PM, Nelson Green nelsongree...@hotmail.com 
 wrote:
 
 On Mon, 31 Dec 2012 14:47:20 Stephen D wrote:
 
 Yes!
 
 Easy standard stuff.
 
 $title = 'Mr.;
 $user_name = 'John Doe';
 
 $message = Hello $title $user_name 
 
 Just define the value for the variables before defining the value for
 the message.
 
 Note that $message has to use double quotes for the expansion. Also
 consider using HEREDOC instead of the double quotes.
 
 You may want to put your message in a text file and using the include
 function.
 
 Hi Stephen,
 
 My message is in a text file, but I'm using fopen and fread in a self-defined
 function, so message is actually defined as (GREETER_FILE is a defined
 constant):
 function print_greeting($user_name)
 {
   $handle   = fopen(GREETER_FILE, r);
   $message  = fread($file_handle, filesize(GREETER_FILE));
   $msg_text = str_replace(USER, $user_name, $message);
 
   print($msg_txt);
 }
 
 And my text file is simply:
 $cat greet.txt
 Hello USER. How are you today?
 
 If I change USER to $user_name in the text file and change the print function
 parameter to $message, $user_name gets printed verbatim. In other words
 the greeting on my page becomes:
 Hello $user_name. How are you today?
 
 I want to pass the name Nelson to the function, and have it output:
 Hello Nelson. How are you today?
 
 after the function reads in text file input that contains a variable 
 placeholder
 for the user name. I actually had a HEREDOC in the function, and that worked.
 But by reading a file instead, I can make things more flexible. I'd rather be
 changing a text file instead of a code file.
 
 I use the include(template) method for this alla time, it works
 great. Most especially for HTML emails coming from a web site to a
 group of users, just slick as anything. include does basically just
 what your print_greeting function does less the actual printout, but
 using php variables instead of a str_replace. Also, this way the
 templates can be stored elsewhere, outside the actual code base if
 need be.
 

This is exactly what I do. Dead simple fast and the templates are fully self 
contained.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] how to build multilingual e-commerce website

2012-12-28 Thread Bastien


Bastien Koert

On 2012-12-28, at 6:19 AM, Sachin Raut imsachinr...@gmail.com wrote:

 Dear Friends,
 
 I have to develop multilingual e-commerce (clothing) website. Could anyone
 who has developed these kind of sites before guide me on how to start the
 development or recommend any tutorial / book for developing these kind of
 sites?
 
 Would really appreciate any inut regarding this.
 
 regards
 Sachin Raut

Start by looking at magento. It's a great ecom shop software 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Strange string stuff -- maybe everything is ending...

2012-12-22 Thread Bastien


Bastien Koert

On 2012-12-22, at 11:50 AM, Tedd Sperling t...@sperling.com wrote:

 On Dec 22, 2012, at 7:58 AM, tamouse mailing lists tamouse.li...@gmail.com 
 wrote:
 
 A bit of an example to shed a little light?
 -snip-
 Not knowing IE really at all, nor it's JS engine, it's entirely
 possible that a null character in a string causes it to have problems.
 
 That's the explanation I was looking for -- thanks!
 


You'll need to check various versions of IE. IE8 has significant JS speed and 
performance issues that don't show up in v7 or v9.

God bless Internet Exploder





 Cheers,
 
 tedd
 
 _
 t...@sperling.com
 http://sperling.com
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Strange string stuff -- maybe everything is ending...

2012-12-21 Thread Bastien

On 2012-12-21, at 5:05 PM, Ken Robinson kenrb...@rbnsn.com wrote:

 A much easier way to do this would be to use a temporary array and then 
 explode:
 
 $tmp = array();
while($row = mysql_fetch_array($result)) // pulling stuff from a 
 database
{
$tmp[] = $row['category'];
}
 
$topic = explode('~',$tmp); // put the delimiter between each entry
echo($topic);   // this result is used in an AJAX script
 


Shouldn't that be implode to convert the array to string with the delimiter?


Bastien

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] storing searching docs

2012-12-13 Thread Bastien


Bastien Koert

On 2012-12-13, at 9:10 AM, Jim Giner jim.gi...@albanyhandball.com wrote:

 Thanks for the input gentlemen.  Two opposing viewpoints!
 
 I understand the concept of using files for the docs and a table to locate 
 them and id them.  But I am of the opinion that modern dbs are capable of 
 handling very large objects (of which these docs are NOT!) much easier than 
 years ago, so I am leaning that way still.  It will certainly make my search 
 process easier!
 
 More comments anyone?
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

I got away from storing blobs in the db. I noticed significant slowness after 
the db grew to about 12gb in MySQL. Back ups also get affected as they take 
longer. This was older MySQL. But it also affected my mssql server the same 
way. 

Nowadays it's files into the file system and data into the db. One thing you 
could consider is reading the contents of the into a db field and just store 
the text to allow the full text search

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] storing searching docs

2012-12-13 Thread Bastien Koert
On Thu, Dec 13, 2012 at 12:41 PM, Matijn Woudt tijn...@gmail.com wrote:
 On Thu, Dec 13, 2012 at 5:13 PM, Jim Giner 
 jim.gi...@albanyhandball.comwrote:

 On 12/13/2012 10:56 AM, Bastien wrote:



 Bastien Koert

 On 2012-12-13, at 9:10 AM, Jim Giner jim.gi...@albanyhandball.com
 wrote:

  Thanks for the input gentlemen.  Two opposing viewpoints!

 I understand the concept of using files for the docs and a table to
 locate them and id them.  But I am of the opinion that modern dbs are
 capable of handling very large objects (of which these docs are NOT!) much
 easier than years ago, so I am leaning that way still.  It will certainly
 make my search process easier!

 More comments anyone?

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


 I got away from storing blobs in the db. I noticed significant slowness
 after the db grew to about 12gb in MySQL. Back ups also get affected as
 they take longer. This was older MySQL. But it also affected my mssql
 server the same way.

 Nowadays it's files into the file system and data into the db. One thing
 you could consider is reading the contents of the into a db field and just
 store the text to allow the full text search

 Bastien

  A very clever idea!  I like it - the best of both worlds.  Can you sum
 up a method for getting the text out of the .doc (or .rtf) files so that I
 can automate the process for my past and future documents?
 Is there a single php function that would accomplish this?


 There's no builtin function for such stuff. doc files are quite tricky to
 parse, but rtf files can be parsed pretty easily. One project is PHPRtfLite
 [1], which provides you an API for doing this.

 - Matijn

 [1] http://sourceforge.net/projects/phprtf/


There is 
http://stackoverflow.com/questions/188452/reading-writing-a-ms-word-file-in-php
which has some discussion on reading those files with Antiword
(http://www.winfield.demon.nl/)

-- 

Bastien

Cat, the other other white meat

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Fwd: PHP Enterprise Bananas

2012-11-06 Thread Bastien


Bastien Koert

On 2012-11-06, at 8:03 AM, Ben Edwards list4...@gmail.com wrote:

 Not sure if this was some type of joke but came across it a while ago.  We
 have some PHP we want to move from a site to a cron.  Is this the answer or
 is there a better way (that does not involve re-writing  code in another
 language).
 
 Cant find a home page for the project, maybe it is defunct.
 
 Ben
 -- 
 *Ben Edwards - Freelance Filmmaker, Bristol, UK
 *http://www.funkytwig.com - View my show-reel and production services
 http://www.icontactvideo.org - iContact Video Network - Community Video
 Group
 http://bristol.mirocommunity.org/ - Bristol Community Channel
 http://bristol.mirocommunity.org/submit_video/ - Submit films to the above
 (takes  10 seconds)
 http://www.icontactvideo.org/news-blog - What it says on the tin
 @funkytwig http://twitter.com/funkytwig - Occasional Twitter postings
 about community video and the multiverse
 
 
 On 6 November 2012 13:01, Ben Edwards list4...@gmail.com wrote:
 
 Not sure if this was some type of joke but came across it a while ago.  We
 have some PHP we want to move from a site to a cron.  Is this the answer or
 is there a better way (that does not involve re-writing  code in another
 language).
 
 Cant find a home page for the project, maybe it is defunct.
 
 Ben
 --
 

I run php thru cron jobs all the time. My app depends on some auto mailings 
happening. There is no issues doing this, you'll just need better logging to 
track the jobs and the results. 

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] SNMP via PHP

2012-10-15 Thread Bastien


Bastien Koert

On 2012-10-15, at 7:09 AM, Lester Caine les...@lsces.co.uk wrote:

 OK I've spent the last two hours going through pages of crap generated by 
 google, and that includes google crap created by searches on sites like 
 http://www.phpbuilder.com - cause mainly of cause by php pages on sites 
 supporting other languages :(
 Certainly it seems that PHP is preferred even to website java and ruby ...
 
 I had some problems over the weekend with the network here and decided it was 
 time to get some monitoring in place locally. cacti simply loaded up and I 
 have working system, but now I'm having trouble getting SNMP sorted on the 
 target machines. So I started looking for an editor to handle the MIB data 
 and keep hitting one dead end after another.
 
 I'm sure there must be something out there using php-snmp for a browser?
 
 -- 
 Lester Caine - G8HFL
 -
 Contact - http://lsces.co.uk/wiki/?page=contact
 L.S.Caine Electronic Services - http://lsces.co.uk
 EnquirySolve - http://enquirysolve.com/
 Model Engineers Digital Workshop - http://medw.co.uk
 Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

Xenoss is a python solution with tons of monitoring capability. It's well worth 
a look

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] foreach

2012-10-15 Thread Bastien


Bastien Koert

On 2012-10-15, at 8:16 PM, David McGlone da...@dmcentral.net wrote:

 I've been sitting here playing around with foreach() and I'm wondering why I 
 am getting these results. here's what I've been fooling around with. the code 
 has no perticular meaning, but I noticed if the script fails, I get the 
 sentence Too expensive I'm going home LOL 6 times because there are 6 words 
 in the sentence. I also have a database that looks like this:
 
 product_idproductprice
 1Milk2.59
 2bread1.05
 
 And when $row is equal to 0 the output I get is
 1 1 Milk Milk 2.59 2.59 Which is printed to the screen according to how many 
 rows are in the db I belive.
 
 So my question is why this behavior? I was expecting something like a while 
 loop.
 
 -- 
 David M.
 

Dave,

Foreach is an iterator over an array. Your $row is a pointer to a db result 
set. If you were to pass the $row result set to the foreach as an array, you'd 
get what you think you should

Www.php.net/foreach
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] cURL issues posting to an end point

2012-10-04 Thread Bastien Koert
Hi All,

I have a page that receives third party data into my app, xml data via
https post. This works fine and I receive the data as expected. The
issue I am facing is around posting XML data back as a synchronous
response to the post I receive. I am using the following code:

function sendXMLConfirmation($data)
{
  /*
   * XML Sender/Client.
   */
  // Get our XML. You can declare it here or even load a file.


  $xml_builder = '?xml version=1.0 encoding=utf-8?
Envelope version=01.00
Sender
Id/
Credential25412/Credential
/Sender
Recipient
Id/
/Recipient
TransactInfo transactType=response

TransactId'.$hash.'/TransactId
TimeStamp'.date(Y-m-d H:m 
).'/TimeStamp
Status
Code200/Code

ShortDescriptionSuccess/ShortDescription

LongDescriptionCANDIDATE Data transfer was a success/LongDescription
/Status
/TransactInfo
Packet
PacketInfo 
packetType=response
PacketId1/PacketId
ActionSET/Action
ManifestManifest 
Data/Manifest
Status
Code/

ShortDescription/

LongDescription/
/Status
/PacketInfo
Payload![CDATA[]]/Payload
/Packet
/Envelope
 ';


  // We send XML via CURL using POST with a http header of text/xml.
$ch = curl_init();

$url = 'https://staging.somesite.com/Sprocessor/DispatchMessage.asmx';

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);   // for https
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 4);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_builder);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: close'));

//Execute the request and also time the transaction ( optional )

$start = array_sum(explode(' ', microtime()));

$result = curl_exec($ch);

curl_close($ch);
// Print CURL result.
echo $ch_result;
}


The endpoint recipient says they are not receiving the data and I am
at a loss to figure out why. Any insight would be appreciated.

Thanks,

-- 

Bastien

Cat, the other other white meat

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] cURL issues posting to an end point

2012-10-04 Thread Bastien Koert
On Thu, Oct 4, 2012 at 1:35 PM, Alejandro Michelin Salomon
amichel...@hotmail.com wrote:
 Bastien:

 -Mensagem original-
 De: Bastien Koert [mailto:phps...@gmail.com]
 Enviada em: quinta-feira, 4 de outubro de 2012 11:54
 Para: PHP-General
 Assunto: [PHP] cURL issues posting to an end point

 Hi All,

 I have a page that receives third party data into my app, xml data via https
 post. This works fine and I receive the data as expected. The issue I am
 facing is around posting XML data back as a synchronous response to the post
 I receive. I am using the following code:

 function sendXMLConfirmation($data)
 {
   /*
* XML Sender/Client.
*/
   // Get our XML. You can declare it here or even load a file.


   $xml_builder = '?xml version=1.0 encoding=utf-8?
 Envelope version=01.00
 Sender
 Id/

 Credential25412/Credential
 /Sender
 Recipient
 Id/
 /Recipient
 TransactInfo
 transactType=response

 TransactId'.$hash.'/TransactId
 TimeStamp'.date(Y-m-d H:m
 ).'/TimeStamp
 Status
 Code200/Code

 ShortDescriptionSuccess/ShortDescription

 LongDescriptionCANDIDATE Data transfer was a success/LongDescription
 /Status
 /TransactInfo
 Packet
 PacketInfo
 packetType=response

 PacketId1/PacketId
 ActionSET/Action
 ManifestManifest
 Data/Manifest
 Status
 Code/

 ShortDescription/

 LongDescription/
 /Status
 /PacketInfo

 Payload![CDATA[]]/Payload
 /Packet
 /Envelope
  ';


   // We send XML via CURL using POST with a http header of text/xml.
 $ch = curl_init();

 $url =
 'https://staging.somesite.com/Sprocessor/DispatchMessage.asmx';

 curl_setopt($ch, CURLOPT_URL, $url);
 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);   // for https
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 curl_setopt($ch, CURLOPT_TIMEOUT, 4);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_builder);

 - curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
 -   curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: close'));

 --- NEW 
 $sPost = '/Sprocessor/DispatchMessage.asmx';
 $sHost = ' https://staging.somesite.com';

 curl_setopt($ch, CURLOPT_HTTPHEADER,
 array(
 'User-Agent: My Program',
 'Accept-Encoding: gzip, deflate',
 'POST ' . $sPost . ' HTTP/1.1',
 'Host: ' . $sHost,
 'Content-type: application/soap+xml; charset=utf-8',
 'Content-Length: ' . strlen($xml_builder)
 );

  END NEW -
 //Execute the request and also time the transaction ( optional )

 $start = array_sum(explode(' ', microtime()));

 $result = curl_exec($ch);

 curl_close($ch);
 // Print CURL result.
 echo $ch_result;
 }


 The endpoint recipient says they are not receiving the data and I am at a
 loss to figure out why. Any insight would be appreciated.

 Thanks,

 --

 Bastien

 Cat, the other other white meat

 --
 PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
 http://www.php.net/unsub.php



Thanks, Alejandro,

So much closer that before, however I am getting an error on this.
Unexpected ';' on line 151 which is the closing array );

curl_setopt($ch, CURLOPT_HTTPHEADER,
array(
'User-Agent: My Program',
'Accept-Encoding: gzip, deflate',
'POST ' . $sPost . ' HTTP/1.1',
'Host: ' . $sHost,
'Content-type: application/soap+xml; charset=utf-8',
'Content-Length: ' . strlen($xml_builder)
);




-- 

Bastien

Cat, the other other white meat

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: building upon the code RE: Differences

2012-10-04 Thread Bastien Koert
On Thu, Oct 4, 2012 at 10:41 PM, Jim Giner jim.gi...@albanyhandball.com wrote:
 On 10/4/2012 10:15 PM, David McGlone wrote:

 I hope I'm not being a pest.

 I've played with the return and echo so much today I've finally realized
 I'm
 going in circles. But I can say I understand it more than ever.

 Now whats on my mind is breaking out of this circle and doing more with
 this
 code. What I am trying to do now is instead of having ALL the images
 display,
 I want to try and group them by their name.

 If I were using SQL I'd simply use a where clause  and be done with it,
 but
 I'm not sure what would acomplish the same thing or similiar to a where
 clause
 in php.


 I dont' see how a where clause in sql provides you with a result that
 organizes the images by name.

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


Read the images into an array and then sort the array...glob() gives
you that array so use one of the many sort functions as you like to
get the order you want

-- 

Bastien

Cat, the other other white meat

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Responding to an XML data post

2012-09-27 Thread Bastien Koert
Hi All,

I am stuck in something where a 3rd party app pushes an XML post to my
site. They need me to respond to that push with a synchronous XML post
back confirming that the data was received / had issues etc. Those
XMLs are defined, but I am not sure how to push that XML back. A
simple

echo $xml;


is not making back to their system. Not sure how I can post back to their site

-- 

Bastien

Cat, the other other white meat

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Images can execute php script?

2012-09-23 Thread Bastien


Bastien Koert

On 2012-09-23, at 11:57 AM, admin ad...@buskirkgraphics.com wrote:

 Today I seen a hack into php that has rocked me to my foundation.
 I seen a picture uploaded onto a server using php and when php displayed the
 image, phpinfo() was executed and displayed.
 
 Does this problem exist in PHP 5.2.17 +?
 How do you stop it?
 
 Sorry, I have never known of this before today.
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

Jpgs can hold other data rather than image data

One thing to try is to run strip_tags($image) to remove any php code

http://stackoverflow.com/questions/3499173/my-php-site-was-hacked-by-codes-uploaded-as-image

http://josephkeeler.com/2009/04/php-upload-security-the-1x1-jpeg-hack/

Bastien

Re: [PHP] Programmers and developers needed

2012-09-13 Thread Bastien Koert
On Thu, Sep 13, 2012 at 8:44 AM, Matijn Woudt tijn...@gmail.com wrote:
 On Thu, Sep 13, 2012 at 2:12 PM, Steven Staples sstap...@mnsi.net wrote:
 From: Tim Dunphy [mailto:bluethu...@gmail.com]
 Sent: September 13, 2012 7:26 AM

  We are looking for programmers and developers to create a world wide
 system.

 Is it bigger than a bread box?

 Will it blend?


 Sure, if you find a big enough blender ;)

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


meh, World Wide Web has been done...

-- 

Bastien

Cat, the other other white meat

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] The end of mysql

2012-09-08 Thread Bastien


Bastien Koert

On 2012-09-08, at 9:54 AM, Jim Giner jim.gi...@albanyhandball.com wrote:

 Nope. No PDO as yet either
 
 jg
 
 
 On Sep 7, 2012, at 11:22 PM, Adam Richardson simples...@gmail.com wrote:
 
 On Fri, Sep 7, 2012 at 9:58 PM, Jim Giner jim.gi...@albanyhandball.com 
 wrote:
 So with the announced end of the mysql functions (and switching to a
 different extension), one would think that my isp/hoster would be a bit more
 interested in my dilemma.  I tried today to create my first mysqli-based
 test script and found that I didn't have that extension.  A series of emails
 with my tech support told me that the shared server farm does not get
 mysqli - only their business servers.  Since I dont' have a need for and
 want to pay more for a 'business server', I'm told I'm s... outta luck.
 
 What about PDO? Is that available?
 
 Adam
 
 -- 
 Nephtali:  A simple, flexible, fast, and security-focused PHP framework
 http://nephtaliproject.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

Change hosts. They are not keeping up
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] use JSON storage on RAMdisk instead of SQL? (for fast moving sites)

2012-09-06 Thread Bastien Koert
On Thu, Sep 6, 2012 at 2:28 PM, Matijn Woudt tijn...@gmail.com wrote:
 Op 6 sep. 2012 12:48 schreef rene7705 rene7...@gmail.com het volgende:

 Hi Folks..
 snip

 I seem to have figured most of this out, but before I embark on weeks
 of coding, I'd like to give the SQL experts here a chance to convince
 me to stick to MySQL for my data storage and distribution needs. I'd
 love to hear of a simple way to efficiently store and operate a forum
 with tree-structures for both subforums and threads-messages using
 MySQL, as my live hoster does not support RAMdisks, not without
 charging me about 70 euro per month instead of the $7 I pay now ;)

 Ok, thanks for reading and possibly considering all this,
  Rene


 Hi Rene,

 I don't call myself an sql expert, but well.. sql is great, but not the
 most efficient. There are more people like you that thought about storing
 data in json. This has proven to be faster in most situations, that's why
 popular platforms like facebook and Twitter don't use sql anymore. Have a
 look at MongoDB for example, it uses bson,binary json. That seems to do
 exactly what you want and you don't have to reinvent the wheel. You can
 choose to store it's data files on ramdisk to make it even faster, but
 mongodb has a pretty good cache.

 - Matijn


+1 for mongo...

If you want to go crazy I would suggest looking at

http://meteor.com or derbyjs.com to build the app. They run on node
and manage the real time changes to the dom content between systems

-- 

Bastien

Cat, the other other white meat

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] FoxPro Table Structure

2012-08-28 Thread Bastien


Bastien Koert

On 2012-08-28, at 11:52 AM, Floyd Resler fres...@adex-intl.com wrote:

 On Aug 28, 2012, at 11:32 AM, Paul M Foster pa...@quillandmouse.com wrote:
 
 On Tue, Aug 28, 2012 at 10:46:24AM -0400, Floyd Resler wrote:
 
 Is there a way in PHP to get the structure of a FoxPro table (using
 ODBC) without having to query the table?  I know I can get it by
 getting a row from the table and using odbc_field_type but I'd rather
 not have to query an entire table since there is no LIMIT command in
 FoxPro.  I've looked and looked and haven't found a solution.
 
 Thanks!  Floyd
 
 FoxPro tables have a header which details the structure of the rows
 which follow it. I've never written PHP code to do what you're asking,
 but I did write a C program which will detail the header, dump the
 records, output the table as SQL and a variety of other things,
 depending on the command line switches. I generally use it *with* PHP,
 using a system() call, capture the results, and then display them on
 screen as needed. The code is on SourceForge. See:
 
 http://noferblatz.com/dbfsak.php
 
 If you download the code and need help, just let me know. I believe the
 command line switch you're looking for is -i, as in:
 
 dbfsak -i mytable.dbf
 
 Paul
 
 -- 
 Paul M. Foster
 http://noferblatz.com
 http://quillandmouse.com
 
 Paul,
Thanks for the info.  Unfortunately dbfsak won't work for me since I don't 
 have direct access to the ForPro dbf files.  I access them through an 
 odbc-odbc bridge server.
 
 Thanks!
 Floyd


Could you do a query like
 

Select * from table where 1=2

That should only return the header row 

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] OT (maybe not): Drupal vs WordPress

2012-08-19 Thread Bastien

On 2012-08-19, at 3:52 PM, l...@afan.net wrote:

 Hi to everyone,
 I was trying to figure this out for the last week or two. I have read tons
 of articles that compare Drupal and WordPress, but I still wasn't swayed
 to either side.
 I know that they are both good, both do the job well, and both have
 advantages and disadvantages. For example, Drupal has a steeper learning
 curve, but you get more control over the website.
 Most of Drupal vs WordPress articles are emotionally driven and it
 reminds me of the PC vs Apple flame war. I was trying to exclude these as
 much as I could but it's hard.
 
 Is there any website/article/benchmark/test/experiment/whatever I can
 trust to be unbiased? I need a website that measures the CMS' through
 facts, not heated, emotional arguments. In which cases is it better to use
 Drupal over WordPress (and vice-versa)? I know the first two words are
 going to be it depends, but let's talk about it in general (for small
 basic websites, more complex websites, easy customization, etc).
 
 I found this on one page: ... Drupal was built as a fine-grained
 multi-role system where you can assign different permissions to different
 roles to do different things (e.g. content editor, content reviewer,
 member, etc.) and assign users to these roles... Does that mean that
 WordPress can't do that? Maybe it can, and the quotation is true, but it
 is kind of misleading to say that one of the programs does something, and
 then not mention the other product at all.
 
 Special points for me are (not a must, though)
 - multiple websites with single core (both CMSs have the capability but I
 got impression Drupal does it better?) because of maintenance
 - compatibility with CiviCRM
 
 Once I decide what to use, I have to stick with it for a while.
 
 Thanks for any help.
 
 

I think the one thing to remember is that Wordpress is at heart a blog. Drupal 
is a CMS. There are some serious scaling issues with Wordpress that I have seen 
that may become a issue for you. 

One thing you didn't mention is site load ( # of users ) and what the goal of 
the site is. If there are a number of essentially static pages and the rest of 
the work done by civicCRM, then maybe just code those pages in HTML and leave 
the rest to the civicCRM. 

But i would, based on the info above, consider Drupal more so. The added 
modules in drupal may make that choice worthwhile down the road

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] embedding php inside of php

2012-06-30 Thread Bastien


Bastien Koert

On 2012-06-30, at 8:00 PM, Tim Dunphy bluethu...@gmail.com wrote:

 Hello,
 
 I am trying to get the hang of php using some examples that I found
 in a book. I've been making progress lately, but one thing has me a
 bit stumped.
 
 
 In an HTML form that I am echoing through PHP I would like to embed
 smaller chunks of php in the code like so:
 
 
 echo 'br /br /
form method=post action=sendemail.php
label for=subjectSubject of email:/labelbr /
input id=subject name=subject type=text value=?php
 echo $subject;?br /
label for=elvismailBody of email:/labelbr /
textarea id=elvismail name=elvismail rows=8
 cols=40?php echo $text;?   /textareabr /
input type=submit name=Submit value=Submit /
/form';
 
 
 
 If I do embed the smaller chunks of php in the form the way I've just
 shown you the script instantly breaks and the web page shows only a
 white screen of death.
 
 And I see this in the web server logs
 
 [Sat Jun 30 19:12:54 2012] [notice] child pid 7769 exit signal
 Segmentation fault (11)
 
 
 If I remove the smaller bits of php as I show here the web page starts
 working again
 
 
 echo 'br /br /
form method=post action=sendemail.php
label for=subjectSubject of email:/labelbr /
input id=subject name=subject type=textbr /
label for=elvismailBody of email:/labelbr /
textarea id=elvismail name=elvismail rows=8
 cols=40/textareabr /
input type=submit name=Submit value=Submit /
/form';
 
 
 Here, I'll show the entire script so you can get a better sense of what it 
 does
 
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
  http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
 head
  meta http-equiv=Content-Type content=text/html; charset=utf-8 /
  titleMake Me Elvis - Send Email/title
  link rel=stylesheet type=text/css href=style.css /
 /head
 body
  img src=blankface.jpg width=161 height=350 alt=
 style=float:right /
  img name=elvislogo src=elvislogo.gif width=229 height=32
 border=0 alt=Make Me Elvis /
  pstrongPrivate:/strong For Elmer's use ONLYbr /br
  Write and send an email to mailing list members./p
 
 ?php
 
  error_reporting(E_ALL);
  ini_set('display_errors', 'On');
 
   if (isset($_POST['Submit'])) {
 
 $from = 'bluethu...@mydomain.com';
 $subject = $_POST['subject'];
 $text = $_POST['elvismail'];
 $output_form = false;
 
 if (empty($subject)  empty($text)) {
 echo 'You forgot the email subject and body.br /';
 $output_form = 'true';
 
}
 
 
 if (empty($subject)  !empty($text)) {
 echo 'You forgot the email subject.br /';
 $output_form=true;
 
}
 
if ((!empty($subject))  empty($text)) {
 
echo 'You forgot the email body text.br /';
$output_form=true;
 
 
}
 
 }  else {
 
  $output_form = 'true';
 
   }
 
 
 
   if ($output_form == 'true') {
 
 
  echo 'br /br /
form method=post action=sendemail.php
label for=subjectSubject of email:/labelbr /
input id=subject name=subject type=textbr /
label for=elvismailBody of email:/labelbr /
textarea id=elvismail name=elvismail rows=8
 cols=40/textareabr /
input type=submit name=Submit value=Submit /
/form';
 
 
  } else {
 
  $dbc = mysqli_connect('127.0.0.1', 'admin', 'secret
 
 ', 'elvis_store')
or die('Error connecting to MySQL server.');
 
  $query = SELECT * FROM email_list;
  $result = mysqli_query($dbc, $query)
or die('Error querying database.');
 
  while ($row = mysqli_fetch_array($result)){
$to = $row['email'];
$first_name = $row['first_name'];
$last_name = $row['last_name'];
$msg = Dear $first_name $last_name,\n$text;
mail($to, $subject, $msg, 'From:' . $from);
echo 'Email sent to: ' . $to . 'br /';
  }
 
  mysqli_close($dbc);
 
 }
 
 
 ?
 
 /body
 /html
 
 
 I was hoping that someone might be out there that could understand
 this problem and point out where I'm going wrong.
 
 Thanks!
 
 -- 
 GPG me!!
 
 gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

You can't have an echo inside and echo. Properly quote and concatenate the 
additional echo and you'll be fine
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] If PHP Were British

2012-06-22 Thread Bastien
I bow to your skillz! That was pretty awesome!

Bastien Koert

On 2012-06-22, at 7:02 PM, Daniel Brown danbr...@php.net wrote:

 On Fri, Jun 22, 2012 at 5:07 PM, Daevid Vincent dae...@daevid.com wrote:
 http://www.addedbytes.com/blog/if-php-were-british/
 
Eh, what the hell, it's Friday
 
http://links.parasane.net/eea4
 
 -- 
 /Daniel P. Brown
 Network Infrastructure Manager
 http://www.php.net/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Searching IDE.

2012-06-13 Thread Bastien Koert
On Wed, Jun 13, 2012 at 9:23 AM, Marc Guay marc.g...@gmail.com wrote:
 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 a more efficient tool.

 Marc

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



I'll throw my 2 cents in...

Netbeans for projects

notepad++ for quick edits
editpad pro (free for linux is really good)


I've also installed Sublime on my mac, but haven't got enough time
with it to have an opinion...

-- 

Bastien

Cat, the other other white meat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Happy Diamond Jubilee everyone!

2012-06-02 Thread Bastien


Bastien Koert

On 2012-06-02, at 4:51 AM, Ashley Sheridan a...@ashleysheridan.co.uk wrote:

 
 
 Paul M Foster pa...@quillandmouse.com wrote:
 
 On Fri, Jun 01, 2012 at 06:44:17PM +0100, Ashley Sheridan wrote:
 
 This is a bit of a shameless plug, but it is a Friday and a pretty
 special weekend over here.
 
 I recently got to work on something a bit fun at work in my spare
 time
 and they liked it so much that it got used internally to celebrate
 the
 jubilee weekend.
 
 This is the result http://jubilee.themlondon.com 
 
 For those of you interested, the leg-work is done by a bunch of PHP
 scripts run in the background via cron, split into 3 tasks:
 
 
 1. A script goes out and searches Twitter for tweets that
 mention
the jubilee, one instance per keyword and records those to a
 DB
to limit the draw on the Twitter API
 2. A second script goes over those tweets and pulls in all the
non-default profile images for each unique user
 3. Lastly, the image is built as 12 separate tiles every half
 hour,
using PHP and GD to match the average colour of each profile
 pic
to a spot on the image, and then these are stitched together
 for
the final image
 
 Anyway, hope you guys all have a great weekend, more so if you're
 unlucky enough to be working over the whole 4 days :-/
 
 *Very* nice work!
 
 Paul
 
 -- 
 Paul M. Foster
 http://noferblatz.com
 http://quillandmouse.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 Thanks, it did take a little while to get right. I might be able to post some 
 bits of code if anyone is interested?
 
 Thanks,
 Ash
 http://ashleysheridan.co.uk
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

I'm sure lots of us are interested. It's very cool. Nice job!

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Simple Email System (SES) Provider

2012-06-01 Thread Bastien Koert
On Fri, Jun 1, 2012 at 8:32 PM, Don Wieland d...@pointmade.net wrote:
 Hi all,

 I built a system in PHP/mySQL where a group of users post events, sign-up
 for events, change their arrival times, remove thier names from events, and
 post related notes on the events. Each time an action is done, an email is
 generated to the entire group that their has been a change. Pretty standard
 stuff...

 Today I just got an Mail Delivery System email with this error:

 Domain dwdcweb.info has exceeded the max emails per hour (350/350 (100%))
 allowed.  Message will be reattempted later

 I contacted my VPS provider and they just alerted me that there is a limit
 on how many emails my server can send per hour.

 They recommended I find a 3rd party service provider with support PHP API
 connections.

 My budget is limited. Does anyone have any suggestions of companies that
 might work for my scenario?

 Any feedback is appreciated ;-)

 Don

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


Amazon has an email service you can plug in to with php

http://aws.amazon.com/ses/


-- 

Bastien

Cat, the other other white meat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Differences between PHP on LAMP and PHP on Windows Servers

2012-05-31 Thread Bastien Koert
On Thu, May 31, 2012 at 9:38 AM, Matijn Woudt tijn...@gmail.com wrote:
 On Thu, May 31, 2012 at 3:29 PM, Gates, Jeff gat...@si.edu wrote:
 From: Matijn Woudt tijn...@gmail.commailto:tijn...@gmail.com
 Date: Wednesday, May 23, 2012 3:59 PM
 To: a...@ashleysheridan.co.ukmailto:a...@ashleysheridan.co.uk 
 a...@ashleysheridan.co.ukmailto:a...@ashleysheridan.co.uk
 Cc: Jeff Gates gat...@si.edumailto:gat...@si.edu, 
 php-general@lists.php.netmailto:php-general@lists.php.net 
 php-general@lists.php.netmailto:php-general@lists.php.net
 Subject: Re: [PHP] Differences between PHP on LAMP and PHP on Windows Servers



 On Wed, May 23, 2012 at 9:35 PM, Ashley Sheridan 
 a...@ashleysheridan.co.ukmailto:a...@ashleysheridan.co.uk wrote:
 On Wed, 2012-05-23 at 20:54 +0200, Matijn Woudt wrote:

 On Tue, May 22, 2012 at 8:15 PM, Gates, Jeff 
 gat...@si.edumailto:gat...@si.edu wrote:
 Can anyone tell me what differences I might encounter by working with PHP 
 on a Unix server verses working with PHP on a Windows server. We use 
 Windows production servers here but many of us would like to get more LAMP 
 environments.

 So, I'm wondering if I can use the hive mind here to get a sense of the 
 pros and cons of each platform.

 Thanks.

 Jeff

 Apart from all other suggestions, one of the most common errors are
 because of different php.ini settings. If you can keep those settings
 (mostly) equal, there will not be that many errors.

 - Matijn



 I would say that's not limited to the distinction between Windows and Linux 
 but any server. I've seen what appears to be an identical setup (same 
 version of PHP, MySQL, etc) fail only because of a small setting in the 
 php.ini file, just because the default was slightly different on the second 
 system; both were running Linux.


 Yes, ofcourse, that comment was meant for any two systems.

 - Matijn

 Well, let me also add a related question: what types of problems might I 
 encounter if I was trying to set up a Drupal or Wordpress instance on a 
 Windows server running PHP as opposed to a Unix server?

 Jeff

 You might need to change a few basic configuration options (paths,
 database, etc) inside Drupal/Wordpress/.., but otherwise those are
 perfectly compatible on Windows  Linux.

 - Matijn

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


Why not install virtualbox or something similar and install a flavor
of linux and use that to do your dev on? It more closely mimics what
will be the operating environment and would lead to less hassles

-- 

Bastien

Cat, the other other white meat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Uploading large files with HTTP_Request class

2012-05-31 Thread Bastien Koert
On Thu, May 31, 2012 at 12:24 PM, Jim Lucas li...@cmsws.com wrote:
 On 05/31/2012 03:28 AM, Voß, Marko wrote:

 Hello,

 I need to perform uploading of large files using the HTTP_Request class:

 http://pear.php.net/manual/package.http.http-request.php

 How am I supposed to do that with this class? Are there any alternatives,
 which do not force me to add new PHP dependancies/libraries to the project?
 I am writing a library and do not want to force the users to add
 dependancies to their projects in order to use this library.


 You don't want to require additional dependencies yet you require PEAR.

 Isn't PEAR an addition dependency?



 I am currently using PHP 5.3.0.


 Thank you and best regards,
 Marko



 --
 Jim Lucas

 http://www.cmsws.com/
 http://www.cmsws.com/examples/
 http://www.bendsource.com/


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


If you don't want dependencies, try swfuploader...uses flash but is
more robust for large file uploads,


-- 

Bastien

Cat, the other other white meat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Bust out a PDF via the print stylesheet?

2012-05-18 Thread Bastien


Bastien Koert

On 2012-05-18, at 12:34 PM, Brian Dunning br...@briandunning.com wrote:

 Hey all -
 
 The articles on my web site already have a very nice stylesheet that produces 
 a print version. Does anyone know if there's a such a thing as a PHP class 
 that would let me put up a Download PDF link that would generate a PDF doc 
 on the fly, using that same stylesheet? I've used various PHP PDF classes 
 before, but I'd rather see if I can shortcut this rather than assembling the 
 doc from scratch.
 
 - Brian
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

Have a look at dompdf.  It's a class that allows you to turn the HTML into a PDF

Bastien 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Running through an enormous SQL file

2012-05-04 Thread Bastien


Bastien Koert

On 2012-05-04, at 7:36 PM, Brian Dunning br...@briandunning.com wrote:

 I have a script that downloads a 267MB SQL file (it creates and loads a MySQL 
 database). Any idea how to do this? Obviously I'm not going to get a file 
 that size into memory to loop through.
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

Break it into chunks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Email Antispam

2012-04-19 Thread Bastien


Bastien Koert

On 2012-04-19, at 1:54 AM, tamouse mailing lists tamouse.li...@gmail.com 
wrote:

 On Wed, Apr 18, 2012 at 8:47 PM, Ross McKay ro...@zeta.org.au wrote:
 On Wed, 18 Apr 2012 11:08:00 -0400, Jim Giner wrote:
 
 He literally wants the addresses visible on the sight?  [...]
 
 Yes, they want the addresses visible and clickable on the website. They
 have contact forms, but they also want the email addresses (of their
 scientists and other consultants) available to their clients. And they
 want the addresses to be shielded against harvesting for spam.
 
 Ob/Deobfuscation schemes that use javascript are a partial solution.
 Many spam harvesters are smart enough these days to know enough about
 decoding email addresses even obfuscated with javascript, with or
 without the mailto: scheme. Any that do obfuscation by substituting
 html entities for the characters are quite easily cracked. (Just
 appearance of a string of html entities is often enough to indicate
 there is something there to decode.) There is no 100% solution here.
 Coming up with clever ways to obfuscate the address on download, and
 deobfuscate it afterwards to display to the user will work for a
 while, however, the people writing spam harvesters are just as clever
 as we are. If the application is going to end up with email addresses
 displayed on the screen, some spam harvester is going to be able to
 get them. Even if you come up with a method that will stop them now,
 it won't stop them forever.
 
 As I said, I don't like doing it this way, but the client gets what they
 want after the options have been explained to them.
 
 They need to understand the options, but even more important, the
 risks of any solution, and of the concept as a whole. After you've
 presented the risks, and the lack of a 100% solution, if they still
 want to do something against their own policies, you have to decide if
 your liability in giving it to them is going to be a problem.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

Could this be a place to consider a flash Based solution?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] SqLite INSERT want not write

2012-04-19 Thread Bastien


Bastien Koert

On 2012-04-19, at 4:11 PM, Silvio Siefke siefke_lis...@web.de wrote:

 On Thu, 19 Apr 2012 13:00:40 -0700
 Tommy Pham tommy...@gmail.com wrote:
 
 Technically, it's date('now') per [1] :)  RTFM FTW!
 
 Yes its right, i have read it on sqlite.org. 
 
 PS: Excuse me, what mean RTFM FTW?
 

Read The Fine Manual For The Win



 
 Regards
 Silvio
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Sorting Help

2012-04-11 Thread Bastien


Bastien Koert

On 2012-04-11, at 2:18 PM, Floyd Resler fres...@adex-intl.com wrote:

 
 On Apr 11, 2012, at 1:11 PM, admin wrote:
 
 
 
 -Original Message-
 From: Floyd Resler [mailto:fres...@adex-intl.com] 
 Sent: Wednesday, April 11, 2012 11:26 AM
 To: PHP
 Subject: [PHP] Sorting Help
 
 I need to sort the following array:
 {
[Smith, Bob]=array(137.5,125.5),
[Jones, Robert]=array(132.7,128.2)
 }
 
 The array needs to be sorted by the first number (i.e. 137.5) and then the
 second in descending order.  I looked at array_multisort but couldn't figure
 out how to make work for my needs.
 
 Thanks!
 Floyd
 
 
 
 Here is what I did to your array
 
 $test = array(Smith, Bob=array(137.5,125.5),Jones
 Robert=array(132.7,128.2));
 asort($test);
 print_r('pre');
 print_r($test);
 
 
 
 That almost worked. I did an arsort() and got the following:
 Array
 (
[Guy, Matt] = Array
(
[0] = 164.67
[1] = 135.67
)
 
[Smith, Toby] = Array
(
[0] = 159.33
[1] = 132.33
)
 
[Young, Matt] = Array
(
[0] = 157.67
[1] = 131.67
)
 
[Shobe, Dale ] = Array
(
[0] = 157.67
[1] = 128.67
)
 
[King, Derrick] = Array
(
[0] = 155.67
[1] = 126.67
)
 
[Reynolds, Jeff] = Array
(
[0] = 155.67
[1] = 133.67
)
 
[Bobo, Tom] = Array
(
[0] = 152.33
[1] = 124.33
)
 
[Henderson, Cody] = Array
(
[0] = 150.33
[1] = 121.33
)
 
[McGuffin, Jimmy] = Array
(
[0] = 145.67
[1] = 118.67
)
 
[Stone, Richard] = Array
(
[0] = 145
[1] = 119.00
)
 
[Biggerstaff, David ] = Array
(
[0] = 142.33
[1] = 115.33
)
 
[Dennis, Daymon] = Array
(
[0] = 142
[1] = 114.00
)
 
[Bush, Duke] = Array
(
[0] = 141
[1] = 121.00
)
 }
 
 That's not the entire array but it sorts just fine except for two entries.  
 For some reason these two aren't sorting in descending order of the second 
 element:
 [King, Derrick] = Array
(
[0] = 155.67
[1] = 126.67
)
 
[Reynolds, Jeff] = Array
(
[0] = 155.67
[1] = 133.67
)
 Everything else sorts just fine.  I'm not sure why that is.
 
 Thanks!
 Floyd
 

Check that you don't have a space in front of those values. That could cause 
some confusion. 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] learning resources for PHP

2012-04-04 Thread Bastien


Bastien Koert

On 2012-04-03, at 10:39 PM, Tim Dunphy bluethu...@gmail.com wrote:

 Hello list,
 
  I am quite sure that you've heard this question at least a few times
 before. :) But I have been dabbling a bit in PHP for years and I've
 decided that its' high time that became serious about getting a solid
 grounding in it. Currently I work as a Sysadmin and have modest but
 reliable skills in bash and perl. But I consider PHP more of an
 artform and I really need to 'pick up a brush and start painting' so
 to speak.
 
  So what I was wondering what websites, and books you'd recommend to
 someone who (for all intents and purpose) is just starting out.
 
  On my hit list of things to learn are basic php / database
 interaction (mysql mainly).. then how to accelerate php interraction
 through memcache.. and eventually one I have all that down onto using
 some of the NoSQLs (mongo/cassandra/membase, etc).
 
 Thanks!
 
 -- 
 GPG me!!
 
 gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

The manual is a great place

Www.php.net 

Then there are tons of sites forum and otherwise to aid your learning. 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] securing a script that exec()s

2012-03-30 Thread Bastien


Bastien Koert

On 2012-03-30, at 5:56 AM, rene7705 rene7...@gmail.com wrote:

 Hi.
 
 I have a script that uses imagemagick's convert command on the commandline
 to get it's work done.
 These calls to exec('convert [params]') take params from the end-user via a
 html form, so is very unsecure.
 
 The intention is that the end-user only runs this script on localhost, from
 localhost.
 
 So now i'm checking $_SERVER['REMOTE_ADDR']===$_SERVER['SERVER_ADDR'] to
 see if I can allow the script to be used.
 
 But unfortunately, $_SERVER['REMOTE_ADDR'] is my external IP, and
 $_SERVER['SERVER_ADDR'] is my internal IP.
 
 How would I best fix this?

Validate the data?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Uploading and creating an email attachment, WITHOUT a DB on server

2012-03-27 Thread Bastien Koert
On Tue, Mar 27, 2012 at 8:41 AM, Christopher Svanefalk
christopher.svanef...@gmail.com wrote:
 Addendum: what standard functions could I invoke to accomplish the file
 system view part?

 On Tue, Mar 27, 2012 at 2:37 PM, Christopher Svanefalk 
 christopher.svanef...@gmail.com wrote:

 Dear all,

 I am rather green to PHP and web programming in general, and would just
 like some pointers how to accomplish the following.

 I have a webpage on a remote host, which supports PHP but does not have a
 DB installed. Here, I have a form where the user can input personal
 credentials, which are then processed and sent as an email message to me
 from the server. This part work so far.

 I want to do the following: the user should be able to upload his/her CV.
 To do so, I need the following:
 1) A way for the user to open a conventional file system view to select
 the file to upload
 2) A way to take this file, add it as an attachment to the mail created in
 the form, and finally send the mail + attachment to my mail.

 Is this possible to do without intermediary storage in a DB? I.e. is it
 possible just to pass the attachment directly from working memory to the
 function for sending email? Or does it have to go intermediare storage?

 Thanks in advance for any help!

 --
 Best,

 Christopher Svanefalk




 --
 Best,

 Christopher Svanefalk

Yo don't need a db for this, but you will need to place the CV onto
the file system so you can attach it to the email. Its not a hard
process if you use something like phpmailer.

Show user form with upload field
process the form on the server (incl file upload)
check the file extension to ensure you're not sending something bad
create the email
attach the file
send
log that you received the file and send the email
unlink the file

-- 

Bastien

Cat, the other other white meat

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Thinking out loud - a continuation...

2012-03-22 Thread Bastien


On 2012-03-21, at 2:39 PM, Jay Blanchard jay.blanch...@sigmaphinothing.org 
wrote:

 This is a continuation of the nested query thing I posted to the list a while 
 back. I was finally able to output a nested unordered array that worked out 
 well, but scope-creep has come in the door and I have to change gears.
 
 I have a project where I have multiple queries and each query uses the 
 results from the previous query to get it's results. I need to do one of two 
 things, either out put a multidimensional array that I can use json_encode() 
 on or I have to format the output from the queries as a JSON string. The 
 resulting JSON will be used by a JavaScript widget and must be formed 
 correctly. I created the following array by hand:
 
 $userList = array(John = array(
 email = j...@demo.com,
 website = www.john.com,
 age = 22,
 password = pass,
 description = array(
 hair = blonde,
 eyes = blue,
 build = medium
 )),
  Anna = array(
 email = a...@demo.com,
 website = www.anna.com,
 age = 24,
 password = pass,
 description = array(
 hair = brunette,
 eyes = hazel,
 build = petite
 )
 ));  
 
 I ran it through json_encode() and got the following output
 
 {John:{email:j...@demo.com,website:www.john.com,age:22,password:pass,description:{hair:blonde,eyes:blue,build:medium}},Anna:{email:a...@demo.com,website:www.anna.com,age:24,password:pass,description:{hair:brunette,eyes:hazel,build:petite}}}
 
 jslint.com verifies this as good JSON (although I thought there had to be 
 square brackets around child arrays).
 
 If you were me would you just generate the JSON? If not what is he best way 
 to output an array that will nest properly for each subsequent query?
 
 Thanks for any insight!
 
 
Would it not be easier to get the data from a view which has the tables joined? 
Then it would be one query and it's a simple matter to format the results into 
the multi dimensional array then json?

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] MySQL table design

2012-03-22 Thread Bastien


On 2012-03-22, at 8:10 PM, Chris Stinemetz chrisstinem...@gmail.com wrote:

 Hello List,
 
 Is it possible to create a MySQL table with characters such as . and
 [] in the column headers? If so would you explain how?
 
 Thank you,
 
 Chris
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

Periods are not allowed, nor other characters that are reflected in file paths. 

You can use the back tick to wrap the field names, but I really don't recommend 
it. If you ever need to port this to another DB, it might not be as forgiving

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Graphing

2012-03-18 Thread Bastien


On 2012-03-18, at 9:33 AM, Ross Hansen hansen.r...@live.com.au wrote:

 Hey all,
 
 I have been working with php for a few years but mostly simple stuff. I'm now 
 looking at doing some graphing but have no experience with dynamic images. 
 
 I have never used imagecreate but have seen one example of it and not sure if 
 it is really what i'm after.
 It needs to graph changing data from a mysql db.
 I also understand php might not be the best option due to the server load.
 
 Just want to get peoples thoughts and suggestions.
 Was so looking at jquery.
 
 Looking forward your responses.
 
 Regards
 Ross
 

If you are looking at a js type dataviz, check out kendo-ui ( built on jquery )

If you want php based then there are tons of options (YMMV)

- phpplot
- jgraph
- etc ( a quick google will give you more)

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] CMS identification

2012-03-18 Thread Bastien


Bastien Koert

On 2012-03-18, at 6:32 PM, Alain Roger raf.n...@gmail.com wrote:

 ok so here it is:
 http://i220.photobucket.com/albums/dd277/alainroger/cms-login.png
 
 
 On Sun, Mar 18, 2012 at 11:25 PM, Stuart Dallas stu...@3ft9.com wrote:
 
 On 18 Mar 2012, at 22:20, Alain Roger wrote:
 
 i have a customer who need to update his website but he was not able to
 tell me more about it.
 he just told me it's a CMS and sent me a screenshot.
 
 To understand what is it i need first to test it on my local server but
 i don't know what is it as CMS.
 could you help me ?
 i attached to my post this screenshot
 
 Attachments get stripped by the list server. Stick it on an image hosting
 service and send us the url instead.
 
 -Stuart
 
 --
 Stuart Dallas
 3ft9 Ltd
 http://3ft9.com/
 
 
 
 
 -- 
 Alain
 ---
 Windows 7 x64 / Fedora 14 x64
 PostgreSQL 8.3.5 / MySQL 5
 Apache 2.2.16
 PHP 5.3.1
 C# 2005-2008

Not enough for the caramilk secret! 

Best just to ask for the server logins and get a look at the code

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Nested database loops and completing an unordered list....

2012-03-02 Thread Bastien Koert
On Fri, Mar 2, 2012 at 7:43 AM, Jay Blanchard
jay.blanch...@sigmaphinothing.org wrote:
 My usual approach to a problem like this to to includes a parent column in 
 the table

 ID (int pk)
 Parent ( default null ) // no parent
 Item
 Itemtype
 [etc]

 Parent will then hold either a null if a top level item, or a structured 
 path ( 1/10/24 ) that notes the parents of the item all the way up to the 
 parent. That way, a single query will get you all items in that parent's 
 lineage to whatever depth is needed by using the child's value

 Select * from table where parent = '1/10'

 Would retrieve all items that are children of a top level of 1 and a second 
 level of 10

 I would do that under normal circumstance but I cannot modify the client's 
 table in any way shape or form. I am considering the COMPANY_ID to be the 
 parent at this point and I can get all who belong to a company. I just need 
 to turn that lineage into a tree.


Would they let you make a copy or a join table where you could build
what you need? Then maybe add a stored proc to move data as needed
-- 

Bastien

Cat, the other other white meat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Nested database loops and completing an unordered list....

2012-03-01 Thread Bastien


On 2012-03-01, at 9:20 PM, Jay Blanchard jay.blanch...@sigmaphinothing.org 
wrote:

 [snip]
 Can you show the output of the function above?
 [/snip]
 
 0
 SELECT DISTINCT `TIER1DATA` FROM `POSITION_SETUP` WHERE `COMPANY_ID` = '3' 
 Executives and Management
 
 Normally this query alone returns 9 rows of data. Each of these rows should 
 be included in the next query where TIER1DATA = each of the nine in succession
 
 1
 SELECT DISTINCT `TIER2DATA` FROM `POSITION_SETUP` WHERE `COMPANY_ID` = '3' 
 AND `TIER1DATA` = 'Executives and Management' 
 Executives and ManagementLeadership
 2
 SELECT DISTINCT `TIER3DATA` FROM `POSITION_SETUP` WHERE `COMPANY_ID` = '3' 
 AND `TIER2DATA` = 'Executives and ManagementLeadership' 
  Executives and ManagementLeadershipManager
 3
 SELECT DISTINCT `BUSTIER1DATA` FROM `POSITION_SETUP` WHERE `COMPANY_ID` = '3' 
 AND `TIER3DATA` = 'Executives and ManagementLeadershipManager' 
   Knee
 4
 SELECT DISTINCT `BUSTIER2DATA` FROM `POSITION_SETUP` WHERE `COMPANY_ID` = '3' 
 AND `BUSTIER1DATA` = 'Knee' 
KneeDIV01
 5
 SELECT DISTINCT `BUSTIER3DATA` FROM `POSITION_SETUP` WHERE `COMPANY_ID` = '3' 
 AND `BUSTIER2DATA` = 'KneeDIV01' 
 KneeDIV01DEPT02
 6
 SELECT DISTINCT `BUSTIER4DATA` FROM `POSITION_SETUP` WHERE `COMPANY_ID` = '3' 
 AND `BUSTIER3DATA` = 'KneeDIV01DEPT02' 
  KneeDIV01DEPT02GRP04
 7
 SELECT DISTINCT `` FROM `POSITION_SETUP` WHERE `COMPANY_ID` = '3' AND 
 `BUSTIER4DATA` = 'KneeDIV01DEPT02GRP04' 
 1054Unknown column '' in 'field list' 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

My usual approach to a problem like this to to includes a parent column in the 
table

ID (int pk)
Parent ( default null ) // no parent
Item
Itemtype
[etc]

Parent will then hold either a null if a top level item, or a structured path ( 
1/10/24 ) that notes the parents of the item all the way up to the parent. That 
way, a single query will get you all items in that parent's lineage to whatever 
depth is needed by using the child's value

Select * from table where parent = '1/10' 

Would retrieve all items that are children of a top level of 1 and a second 
level of 10

Hth

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Test

2012-02-20 Thread Bastien
Definitely doesn't work

Bastien Koert

On 2012-02-20, at 2:21 PM, Jason Pruim li...@pruimphotography.com wrote:

 Nope doesn't work, ;)
 
 
 
 On Feb 20, 2012, at 1:57 PM, Jay Blanchard 
 jay.blanch...@sigmaphinothing.org wrote:
 
 Does this work?
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] is it possible to change the html title from the WYSIWYG editor?

2012-02-13 Thread Bastien


Bastien Koert

On 2012-02-13, at 5:34 PM, Haluk Karamete halukkaram...@gmail.com wrote:

 Yeah, but n the context of wordpress, that does not fly.
 If I do a die; in the middle of wp's tinymce editor, and check back
 the page, the title is already out there.
 
 first 5 lines would be something like
 
 
 !DOCTYPE html
 html dir=ltr lang=en-US
 head
 meta charset=UTF-8 /
 titlethe wordpress page title we were trying toi change is already
 here.../title
 link rel=profile href=http://gmpg.org/xfn/11; /
 
 But this question is a wp question. I accidentally dropped it in the PHP 
 group.
 
 On Mon, Feb 13, 2012 at 2:24 PM, Daniel Brown danbr...@php.net wrote:
 On Mon, Feb 13, 2012 at 17:15, Haluk Karamete halukkaram...@gmail.com 
 wrote:
 
Please keep the replies on the list for all to benefit, including
 the archives.
 
 Isn't it TinyMCE considered a WYSIWYG one? but, anyway, that's beside
 the main point.
 
Indeed.  Hence:
 
 even web-based things like TinyMCE, et al.
 
 To your suggestion...
 
 I don't think your snippet would do any good as far as search
 engines...  search engines would still take the title in the head.
 here, we are already in the the_content().
 
Did you understand what I meant by very basic example?  You'd
 need to modify your title.*/title tag in the head, as well,
 obviously.  That's all quite logical, and well beyond the scope of the
 initial question.
 
 --
 /Daniel P. Brown
 Network Infrastructure Manager
 http://www.php.net/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

Any reason you can't just use JS to alter the title tag on the page loading?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] What's Your Favorite Design Pattern?

2012-02-07 Thread Bastien

On 2012-02-07, at 2:34 PM, Daniel Brown danbr...@php.net wrote:

 On Tue, Feb 7, 2012 at 13:56, Mike Mackintosh
 mike.mackint...@angrystatic.com wrote:
 I was curious to see what everyones favorite design patterns were, if you 
 use any, and why/when have you used it?
 
 Choices include slots and signals (observer), singleton, mvc, hmvc, factory, 
 commander etc..
 
Mine is apparently CPSV (Commentless Procedural Spaghetti Vomit),
 as that's what I encounter no less than 80% of the time in the wild.
 
 -- 
 /Daniel P. Brown
 Network Infrastructure Manager
 http://www.php.net/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

I think you should trademark that, Dan 

Bastien Koert
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] advise needed on a mysql select library function

2012-01-13 Thread Bastien

On 2012-01-13, at 2:18 PM, Haluk Karamete halukkaram...@gmail.com wrote:

 Why discover the wheel, where there are so many qualified pros are
 here that pick up their brains...
 
 I'm building a php library of functions, I mean day to day functions
 that eases my RAD.
 
 Since I am new to PHP, I'm trying to wrap php's built-in-functions and
 funtionalities into new function names of my own creation from my old
 ASP library so that I can work within the new php environment - using
 still the familiar function names and arguments ... for example, i had
 a leftof function which worked as
 
 leftof(abcef,bc) //returns ef
//which is the leftof the bc in the haystack abcdef.
 
 That's the idea... I have over 100 functions that does all kinds of
 things... the goal is to write those functions' php equaivalents. I'm
 done with the string and utility functions, now I m getting into db
 stuff!
 
 My goal now is to write a one-liner sqlselect functionality which will
 work like this
 
 ?php
 
 _select(my_wordpress_database_name_here,SELECT * FROM wp_posts,$result);
 
 //so that I can instantly get into business as follows;
 
 while ($row = mysql_fetch_assoc($result)) {
echo li . $row['post_title'];
 }
 
 basically, what the _select is supposed to do is to take the passed
 database name, look that up in a switch statement to get the sql
 server, db uid  pwd info and run the whole show all the way until it
 puts the results in the $result resource. And I'm already done with
 that...  I posted the code below...  but I want to isolate the switch
 statement ( that contains the sqlserver,uid,pwd data ) out from this
 library file...  I do not want to keep them in the library. ideally,
 that info should be kept in say, connection_info.php file...
 
 how would you go about it?
 
 write an include directive ( for the switch section only) and
 implement it that way? or is there a better way - such as using a
 function for the switch?
 please fell free to not only answer this question but also improve the
 code segment I posted below. I will be using the principles I gain
 from this thread in writing the update,delete and insert versions...
 
 this is where I am now and following code snippet works as intended...
 
 
 
 _select( wordpress_XYZ , SELECT * FROM wp_posts , $result );
 
 while ( $row = mysql_fetch_assoc($result)) {
echo li . $row['post_title'];
 }
 
 function _select($db_name,$sql,$result)
 {
 
 
 
 
switch (bp_lcase($db_name))
{

case  wordpress_XYZ;

$db_name = ; // this is usually the same as the 1st argument
 passed by the user
$db_server = ;
$db_username = ;
$db_pass = ;
break;

case  :

echo Unknown database.;
die;

break;

default:

echo Database name not passed;
die;
break;

}

$link = mysql_connect($db_server, $db_username, $db_pass) or
 die(mysql_error());
mysql_select_db($db_name, $link) or die(mysql_error());
$result = mysql_query($sql,$link) or die(mysql_error());
mysql_close($link);
 
 
 
 
 }
 
 in the above code, ideally I would want to store the switch stuff
 somewhere else... the question is what's the most elegant/proper way
 of doing this...
 
 now... that switch could be included as is from a plain file, that's
 easy enough...
 
 or it could be put into a function so that _select function internally
 calls it and get the handle of the $link so that
 mysql_select_db($db_name, $link) can run fine...  in that case, should
 the $link be passed $ by ref? any issues with that?
 
 which approach is better? or are there other issues that I must be
 aware of in starting building such a library?
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

You seem to be spending time on rebuilding what a lot of frameworks already 
have/do.

I suggest looking at them first.
Code igniter
Cake php
Symfony
Zend
Fuelphp

Personally, codeigniter might be the best choice as its not an overwhelming 
framework and it's got great docs


Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PDF Printing instead?

2012-01-05 Thread Bastien

On 2012-01-05, at 3:14 PM, Jim Giner jim.gi...@albanyhandball.com wrote:

 ok - somebody has advised that I should not be trying to print to a printer 
 from my website php script.
 
 The suggestion of creating a pdf and sending to the client was made.  How do 
 I install the pdf functions?  I've never had to install a package before or 
 is that something my hoster does? 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

Also try dompdf from digitaljunkies.ca. It allows you to pass an HTML doc to 
the code to provide a PDF

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] New to mac and trying to define a php.ini file.

2012-01-04 Thread Bastien


On 2012-01-04, at 10:03 AM, L M Andrews lew...@imagearts-inc.com wrote:

 Hi,
 
 Or should I just be looking somewhere else?
 
 Yes, if you're setting up a local development environment on a Mac, the
 painless solution is to install MAMP (m as in Mac). Everything installs
 into a single folder (easily deletable, too) without modifying any of the
 original versions that might have come with OSX.
 
 There's a free version and a paid pro version here:
 http://.mamp.info
 
 Hope this helps,
 L
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
MAMP is the easiest way to keep it all together and set up. Gets my vote too

Bastien

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Alternative session control system

2011-12-26 Thread Bastien

On 2011-12-26, at 7:04 AM, Francisco M. Marzoa Alonso franci...@marzoa.com 
wrote:

 Hello,
 
 I need an alternative session control system different from the PHP
 standard one, that does not need to use the headers, because it's for a
 series of scripts that will be accessed through AJAX javascript code
 inserted in different places of a web page which headers I do not
 control, so I cannot do an start_session before headers sent or
 setcookies neither.
 
 I have an idea on how to solve this, based on client IP, but if there is
 something done yet, I do not want to reinvent the wheel from scratch.
 
 Thanks a lot in advance,
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

The initial page load will contain some HTML and the js code needed for the app 
to work. This is the perfect place to launch the session and set the session 
cookie and the standard HTML headers. Ajax will only start after that initial 
page load and won't affect the first time the app is accessed

Bastien Koert
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] number_format

2011-12-19 Thread Bastien Koert
On Mon, Dec 19, 2011 at 9:19 AM, Floyd Resler fres...@adex-intl.com wrote:
 In the previous version of PHP we were using, I could pass a string to 
 number_format and it would just change it to a 0 without complaint.  With 
 5.3.6 I get an expects double error.  I don't suppose there's a way to make 
 it work like it used to???  I'm dealing with really old code that wasn't very 
 well structured.

 Thanks!
 Floyd


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



Could you check it before formatting? Or if the data is coming from
the db, force it to 0 if null?

$var = (is_double($number_var)) ? $number_var : 0;



-- 

Bastien

Cat, the other other white meat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Working on a Subsummary Report

2011-12-16 Thread Bastien Koert
On Fri, Dec 16, 2011 at 1:49 PM, DealTek deal...@gmail.com wrote:


 I would give consideration to the 'group by' function for your query, and 
 loop through that.

 Thanks Mike - will do...

 --

 *beginner question* - what would we call this type of query/display:

 reporting or summary or ? I'm not sure what terms look up?

 it would be similar to query all categories and their products sold in a year 
 and display like:

 summary heading1
 CAT 1
  sub head 1--- Prod 1

 --- sales prod data 1
 --- sales prod data 2 etc

  sub head 2--- Prod 2

 --- sales prod data 3
 --- sales prod data 4 etc

 summary heading2
 CAT 2
  sub head 3--- Prod 3

 --- sales prod data 5
 --- sales prod data 6 etc


 any other hints will help a lot...

 --
 Thanks,
 Dave - DealTek
 deal...@gmail.com
 [db-11]




 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


what about creating a master report that has the total summarized by
category and then offering a drill thru type structure to dig deeper
in certain areas?


-- 

Bastien

Cat, the other other white meat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Auto CRUD Generator Xataface

2011-11-29 Thread Bastien Koert
On Tue, Nov 29, 2011 at 4:13 PM, Jim Lucas li...@cmsws.com wrote:
 On 11/29/2011 12:54 PM, Daevid Vincent wrote:


 -Original Message-
 From: Matijn Woudt [mailto:tijn...@gmail.com]
 Sent: Tuesday, November 29, 2011 12:48 PM
 To: Daevid Vincent
 Cc: php-general-h...@lists.php.net; php-general@lists.php.net
 Subject: Re: [PHP] Auto CRUD Generator Xataface

 On Tue, Nov 29, 2011 at 9:44 PM, Daevid Vincent dae...@daevid.com wrote:
 -Original Message-
 Search Google for Xataface.  It's a full frontend which
 dynamically changes with database structure changes.

 http://xataface.com/videos is broken and therefore we can't view the demo,
 and nothing pisses me off more than a site that doesn't have a simple
 contact email link!

 UGH!


 I think your PC is broken.. I can watch the videos just fine ;)

 I tried it in FF 3.6.24 as well as Chrome 15.0.874.121 m (is that really 
 necessary Google?!) and lastly IE 8.0.7601.17514 (is that really necessary 
 Micro$oft?!). All on Win7 64-bit burley-ass Dell PC.

 I code in PHP all day long and have no troubles with other websites. Not 
 even other pages on THAT web site. That particular tab / page however 
 only shows the logo top left, search top right, and then these in the tabs:

       Home Forum Documentation Videos a href=http://

 And the rest of the page is white.

 Garbage.



 System: Windows XP 32-bit

 I run FF 5.0.1 w/NoScript and I had allow both xataface.com and weblite.ca 
 then
 the video popped up.

 IE 6.0 on the same system works fine too.

 --
 Jim Lucas

 http://www.cmsws.com/
 http://www.cmsws.com/examples/
 http://www.bendsource.com/

 C - (541) 408-5189
 O - (541) 323-9113
 H - (541) 323-4219

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



Works for me as well in Chrome


-- 

Bastien

Cat, the other other white meat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Tutorial for the structure of an php-app ?

2011-11-25 Thread Bastien


On 2011-11-25, at 7:38 PM, Andreas maps...@gmx.net wrote:

 Hi again,
 is there a tutorial for the structure of an php-app?
 
 There are more than enough books and online docs that teach the basics of PHP 
 and of course the native mysql commands.
 
 I'd now rather need a help to figure out how to pull up a wee bit more 
 complex app.
 I know how to connect to a DB even though it might not be mysql. I can select 
 stuff and dump it into a HTML table.
 Actually I prefer PDO and PostgreSQL.
 
 Is there a tutorial that teaches how to construct a app with a 2-column 
 design.
 E.g. a menue frame on the left and a bigger content area on the right.
 So a click on a menue item would dynamically display a form or a list in the 
 content area.
 What is a good way to glue everthing together between login and logout.
 I know cookies and sessions and I suspect those were a way to do it.
 How would I integrate a template system like smarty?
 It weren't bad if there were clues about AJAX, too.
 
 I'm in search of a way to extend the knowledge about bricks, tubes and cables 
 to the wisdom to actually build a house out of those things.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

Why not download some and dig into them? Something from sourceforge or a cms 
like pyrocms? See how they stuck it all together. 

Bastien Koert
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] json_encode confusion

2011-11-10 Thread Bastien Koert
Morning all,

I've been having some fun with converting a text data file import into
a json object for storage.

I have a text file that is pipe delimited coming in via an upload. The
first row is the headers and the second row is the data.

Using this code:

$data = file(inline_Nov_8_2011.txt);

if(count($data)==2){

$keys   = explode(|, $data[0]);
$fields = explode(|, $data[1]);   

$combine = array_combine($keys, $fields);

$json = json_encode($combine);
}

After the combine, I get an array that looks like this

Array
(
['Legal Last Name '] = Andros
['Legal Middle Initial '] =
['Legal First Name '] = Marisa
['Maiden/Other Name '] =
['Social Insurance No. '] = 123456789
['Date of Birth '] = 2/1/1988
['Gender '] = Female
)

But the json encoded value looks like this (there are way more
elements but this should be enough to represent what I need to do).

{null:Andros,null:,null:Marisa,null:,null:123456789,null:2\/1\/1988,null:Female}

I have been googling for info about allowed values for the json keys,
but can't seem to find a clear doc on what is allowed and what isn't.
I have tried unquoted keys, replaced the spaced with underscores but
nothing I do seems to help.

When I echo out the json encoded data, the keys are all nulls.

Can someone point me in the correct direction? It may be that I need
to manually create the key names as an array first, which I was hoping
to avoid since the file format coming from the client is still in some
flux.

-- 

Bastien

Cat, the other other white meat

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Converting string to array index

2011-11-05 Thread Bastien


On 2011-11-05, at 10:21 PM, Ethan Rosenberg eth...@earthlink.net wrote:

 Dear list -
 
 I have an associative array that will return a string representing an array 
 index.  I now need to convert this string into an actual array index.
 
 $test1 = array
 (
 e1 = [4][7],
 e2 = [5][8]
 );
 
 so.. $z = $test1['e1'];
 z has the value of [4][7].  I need to convert this string to an array index 
 so I can use it in $results[4][7].
 
 How do I do it?
 
 Thanks.
 
 Ethan
 
 MySQL 5.1  PHP 5.3.3-6  Linux [Debian squeeze(sid)]  
 
 
 -- 
 

Array_flip()?

http://php.net/manual/en/function.array-flip.php


Bastien

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Novice question

2011-10-30 Thread Bastien

On 2011-10-30, at 2:45 PM, Marc Guay marc.g...@gmail.com wrote:

 I want to write a script that requests a URL and then reads that website
 .. I'm interested to map web structures. My web host is saying I'll need
 URL file access enabled but that it's a) a security risk and b)
 deprecated.
 
 
 simplehtmldom is pretty great for this, if I understand your needs
 correctly... also not sure about it's server setting requirements, but
 worth a look..
 
 
 http://simplehtmldom.sourceforge.net/
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

Another option is cURL www.php.net/curl

Bastien Koert
905-904-0334


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Exporting large data from mysql to html using php

2011-10-25 Thread Bastien




On 2011-10-25, at 6:56 PM, Jason Pruim li...@pruimphotography.com wrote:

 
 Jason Pruim
 li...@pruimphotography.com
 
 
 
 On Oct 25, 2011, at 6:35 PM, Jim Giner wrote:
 
 Again  why even do a detail query?  Nobody is going to examine pages and 
 pages and etc.  
 Do a summary qry if u just need a count - no pagination there
 jg
 
 
 The bosses wanted them to be able to page through the results... But I might 
 bring that up to them again... Working with 89 million records (With the 
 number going up and expanding in the future) could cause lots of issues in 
 the long run...

Guarantee the bosses will never use it. If they had to page thru 89m records, 
they'd rebel too







 
 
 
 On Oct 25, 2011, at 6:26 PM, Jason Pruim li...@pruimphotography.com wrote:
 
 
 Jason Pruim
 li...@pruimphotography.com
 
 
 
 On Oct 25, 2011, at 10:51 AM, Jim Giner wrote:
 
 I disagree.  It's not about tuning the queries, it is more about the 
 appl. 
 design that currently thinks it SHOULD do such huge queries.
 
 My approach would be to prompt the user for filtering criteria that 
 automatically would reduce the result set size.  Although at this time I 
 believe the OP mentioned that the db is just telephone numbers so that 
 doesn't leave much room for filter-criteria. 
 
 
 
 Yes it is just phone numbers... The only select that I'm running on the 
 entire site is related to the pagination... A simple:
 $sqlCount = SELECT COUNT(*) FROM main WHERE state = '{$state}';
 
 which limits it to everything inside the state... Unfortunately if you look 
 at the possibilities, it's still quite a large dataset... 89 million :)
 
 The rest of the query's will be much more limited to areacode, exchange, 
 and in some cases the full phone number... Maybe the better way to do it 
 would be not to count the records But set a variable with the total 
 count... That way I don't have to load all the data... The data amount 
 won't change alot... Easy enough to set a variable...  Just need to see if 
 I can integrate that with the pagination...
 
 Back to the drawing board! :)
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

Bastien Koert
905-904-0334
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Exporting large data from mysql to html using php

2011-10-24 Thread Bastien


On 2011-10-24, at 8:50 PM, Jason Pruim li...@pruimphotography.com wrote:

 Now that I've managed to list 3 separate programming languages and somewhat 
 tie it back into php here's the question...
 
 I have about 89 million records in mysql... the initial load of the page 
 takes 2 to 3 minutes, I am using pagination, so I have LIMIT's on the SQL 
 query's... But they just aren't going fast enough...
 
 What I would like to do, is pull the data out of MySQL and store it in the 
 HTML files, and then update the HTML files once a day/week/month... I can 
 figure most of it out... BUT... How do I automatically link to the individual 
 pages?
 
 I have the site working when you pull it from MySQL... Just the load time 
 sucks... Any suggestions on where I can pull some more info from? :)
 
 Thanks in advance!
 
 
 Jason Pruim
 li...@pruimphotography.com
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

That's a ton of data. So there are a couple of questions:

1. Is the data ordered in any way? 

The issue is that you might need to regenerate the files if new data needs to 
be interspersed.

2. Why is pagination slow? 

A LIMIT with an OFFSET should be very quick if the table is properly indexed. 
Is there any tuning that you can do to further filter the results? Say by date 
or some other criteria? Have you run an EXPLAIN plan on the db to show how the 
queries are being run?

Other thoughts:

- are your indexes up to date? Have you optimized those index to be clean, not 
fragmented, and therefore fast?

- can you organize the data by some criteria to better show the results? Like 
by date? Or by starting alpha character? Or by category?

Bastien Koert
905-904-0334





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Geo IP Location help needed...

2011-10-24 Thread Bastien

On 2011-10-24, at 9:07 PM, DealTek deal...@gmail.com wrote:

 newbie question!
 
 Hi all,
 
 So, I had - Geo IP Location -  installed for me on my VPS server by a network 
 tech
 
 http://us3.php.net/manual/en/book.geoip.php
 
 
 then I used: 
 
 geoip_country_name_by_name(xxx) to display the country by name
 
 basically works ok - however a few people say that my page: 
 
 1- will display their remote ip with $_SERVER['REMOTE_ADDR'];
 
 2- ! but for some - the country name is blank ! (defeats the whole 
 purpose)
 
 - I am not sure how:  Geo IP Location actually works...  
 
 Q: Am I correct in assuming that when a country name does NOT show - is it 
 because that particular IP is NOT seen by Geo IP Location?
 
 We just installed the latest version (I think) yesterday 
 
 Is it reading from some old outdated database - or 
 
 
 
 Q: Is there some code that can ALWAYS tell the country name of the IP?
 
 
 
 
 --
 Thanks,
 Dave - DealTek
 deal...@gmail.com
 [db-11]
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

Dave,

If the IP is showing, could there be some left over debug in some function?

If the IP is not in your list it could be anything from a new range for a 
region to IP spoofing or some anonymizer or even an old DB

Bastien Koert
905-904-0334
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Exporting large data from mysql to html using php

2011-10-24 Thread Bastien

On 2011-10-24, at 10:44 PM, Jim Giner jim.gi...@albanyhandball.com wrote:

 Why would any user need to have access to 89M records?
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

History or audit trail data? I can think of lots. I know of an app with a 
poorly designed system that easily gets over 240 million

Bastien Koert
905-904-0334
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Exporting large data from mysql to html using php

2011-10-24 Thread Bastien


On 2011-10-24, at 11:26 PM, Jim Giner jim.gi...@albanyhandball.com wrote:

 Yes - but - we're talking about a user-app that the OP is trying to provide 
 89M records to.  Sure - some users might have need of looking at even as 
 much as a million records IF they were researching something that needed it. 
 But - for the 'general' user of an app - I cannot see a need to be providing 
 even that much data.  Think about it - you give the user 1M records, how 
 long is that user going to page thru the results?  Let's say there are 20 
 results on a page and it takes a mere (wow!) 2 seconds to scan thru them 
 looking for something apparently very obvious.  That's 600 results viewed 
 per minute at best.  Six hundred into a M is 1666 minutes which is 27+ 
 hours.  Even at 1 second per page view time, it's still more time than in a 
 normal work day.  And you want come up with a way to feed him 89M?
 
 The problem needs to be looked at differently - put together a 
 business-smart solution to finding the  needle in this haystack of  89M 
 pieces of straw and only then apply technology to it.
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

I agree, Jim. Which is why I was asking a about tuning the queries. Jason 
already indicated he was using limits and offsets, so it's other avenues i was 
looking for.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Exporting large data from mysql to html using php

2011-10-24 Thread Bastien

On 2011-10-24, at 11:14 PM, Jason Pruim li...@pruimphotography.com wrote:

 
 Jason Pruim
 li...@pruimphotography.com
 
 
 
 On Oct 24, 2011, at 9:20 PM, Bastien wrote:
 
 
 
 On 2011-10-24, at 8:50 PM, Jason Pruim li...@pruimphotography.com wrote:
 
 Now that I've managed to list 3 separate programming languages and somewhat 
 tie it back into php here's the question...
 
 I have about 89 million records in mysql... the initial load of the page 
 takes 2 to 3 minutes, I am using pagination, so I have LIMIT's on the SQL 
 query's... But they just aren't going fast enough...
 
 What I would like to do, is pull the data out of MySQL and store it in the 
 HTML files, and then update the HTML files once a day/week/month... I can 
 figure most of it out... BUT... How do I automatically link to the 
 individual pages?
 
 I have the site working when you pull it from MySQL... Just the load time 
 sucks... Any suggestions on where I can pull some more info from? :)
 
 Thanks in advance!
 
 
 Jason Pruim
 li...@pruimphotography.com
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 That's a ton of data. So there are a couple of questions:
 
 1. Is the data ordered in any way? 
 
 Data is in numeric order in the database, but not specifing a ORDER BY on the 
 SELECT..
 
 The issue is that you might need to regenerate the files if new data needs 
 to be interspersed.
 
 Indexes are freshly done... I might need to tweak them and learn more about 
 them... Working on that right now!
 
 2. Why is pagination slow? 
 
 Pagination isn't all that slow... Just the initial load of the site... The 
 rest of it works fairly well... But the guys with the paychecks aren't going 
 for a 2-3 minute initial load time on a public website
 
 A LIMIT with an OFFSET should be very quick if the table is properly 
 indexed. Is there any tuning that you can do to further filter the results? 
 Say by date or some other criteria? Have you run an EXPLAIN plan on the db 
 to show how the queries are being run?
 
 Other thoughts:
 
 - are your indexes up to date? Have you optimized those index to be clean, 
 not fragmented, and therefore fast?
 
 
 Just generated the indexes so it should be completely perfect.
 
 - can you organize the data by some criteria to better show the results? 
 Like by date? Or by starting alpha character? Or by category?
 
 Trying to split up the data some... It's phone numbers... So I have the area 
 code, exchange, and the subscriber number stored in 3 separate fields... But 
 that doesn't seem any faster then when I had it all in one field
 
 I think I just need to rethink the design a little bit, and optimize the 
 entire app... But I think that will hit tomorrow.
 
 Thanks for your suggestions!
 
 Bastien Koert
 905-904-0334
 
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

My preference would be to have that as one numeric field ( bigint ) and search 
on that. DBs like numbers and should be able to return the data very quickly

As for the app start, can you present a tiny ( say 10 rows ) subset that you 
could read in from a cache? Perhaps the 10 most common searched on or last 10 
used? You could cache it for an hour and then refresh it. Same thing applies if 
the start is like a dashboard with various reports. Cache out what you can and 
hit the DB for the bare minimum to keep people happy

Then your app should be right quick 
to start 

Bastien Koert
905-904-0334


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] newline and return issues in string

2011-10-11 Thread Bastien Koert
On Tue, Oct 11, 2011 at 7:58 AM,  ad...@buskirkgraphics.com wrote:
 I have come across an issue with my string that I would like to find a
 faster way to resolve.

 It seems there are new lines and returns at different positions of the
 string.



 First I exploded on the new line explode(“\n”, $ string)

 This gave me a nice array but when I try to implode I get the new lines
 again.

 There is not a consistent position and there seems to be some hidden returns
 in the array as well.



 Is there a way, or has someone written a filter that would allow me to
 remove all the newlines and returns from the array or string.

 Understand I have resolved this issue but I think I have to be going about
 this the hard way because it is just too complex .



 FYI

 $filter = array(\r\n, \n, \r);

 str_replace($filter,’’,$string) ß this is useless in this situation I have
 tried and it does not change the string at all.

 Understand the newlines and returns do not display in the string as
 literals. Meaning you do not see /n or /r it is hidden.







What about using nl2br() and then stripping out all the BR tags?

-- 

Bastien

Cat, the other other white meat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: files outside of documentRoot

2011-10-11 Thread Bastien Koert
On Tue, Oct 11, 2011 at 11:00 AM, Ricardo Martinez harisel...@gmail.com wrote:
 Hi!

 i'm was checking, readfile(); and fpassthru();

 With easy examples, i can use it for show a pic in the screen and download a
 file, from outside of documentRoot. It works fine.

 The problem that i have now, is, i need can work with it, inside of other
 documents, but i'm getting all time error by the headers. ( already sendt
 ... )

 Anyone knows how to use it for can call the files and work together with
 other page ¿?

 Thanks

 On Sun, Oct 9, 2011 at 6:57 PM, Sean Greenslade zootboys...@gmail.comwrote:


 On Sun, Oct 9, 2011 at 9:52 AM, Ricardo Martinez harisel...@gmail.comwrote:

 The files are, png, pdf and flv.

 Only users login can see or download it.

 thx ;

 On Sat, Oct 8, 2011 at 11:16 PM, Shawn McKenzie nos...@mckenzies.net
 wrote:

  On 10/08/2011 03:40 PM, Ricardo Martinez wrote:
   Hi List!
  
   I need to access files outside the DocumentRoot.
  
   I've been looking for info and documentation, and I've read that it
 can
  be
   done using symbolic links and another way is by using headers.
  
   I want to know, what do you think, what is the best way, and if anyone
  knows
   a good doc about of it.
  
   Thanks!!!
  
 
  It depends on what you mean by files.  Are they PHP files that need to
  be run, or images, or files that need to be downloaded by the user?
 
  For PHP, you would add the external dir to your include path.
 
  For images you can use a php file as the img src and that file sets the
  appropriate headers and uses readfile() to get and echo the image data:
  getimage.php?image=someimage.gif
 
  For download files you would do it in the same manner as for images:
  download.php?file=somefile.zip
 
 
  --
  Thanks!
  -Shawn
  http://www.spidean.com
 

 --
 Ricardo
 ___
 IT Architect
 website: http://www.pulsarinara.com



 Sounds like the downloader php script would be perfect (what Shawn
 suggested). Have the script check the login status, then (if valid) send the
 proper headers for the file and read out the data with the script.

 --
 --Zootboy

 Sent from my PC.




 --
 Ricardo
 ___
 IT Architect
 website: http://www.pulsarinara.com


For images and the like, I have a separate page that is called that
handles the image and the headers needed

In the page I have some thing like

echo img src='get_image.php?id=$id';

Then in the get-image.php page i have the code that gets the image
from the db, outputs the appropriate headers and then outputs the
image

-- 

Bastien

Cat, the other other white meat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php on my pc, no go, FUBAR, thank you Bill Gates?

2011-10-04 Thread Bastien Koert
On Tue, Oct 4, 2011 at 9:47 AM, Kirk Bailey kbai...@howlermonkey.net wrote:
 I installed it in a Windows XP PC with a cgi capable server in it. No dice,
 nothing happens. I also installed python in the same computer. Works
 perfect. NEITHER language modified the http server.

 So, what do I have to do to get php to play well with others in a XP
 environment? Cute remarks about install Linux shall be ignored as
 line-noise.



 --
 end

 Very Truly yours,
                 - Kirk Bailey,
                   Largo Florida

                       kniht
                      +-+
                      | BOX |
                      +-+
                       think


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



Kirk,

Are you running this via IIS or Apache? If IIS, download and install
the MS Web Platform app. Use that to install drupal or wordpress and
it will install PHP and mysql for you running under IIS

-- 

Bastien

Cat, the other other white meat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] book quest

2011-09-28 Thread Bastien Koert
On Wed, Sep 28, 2011 at 6:20 PM, Kirk Bailey kbai...@howlermonkey.net wrote:
 The best book for a beginner? No, don't tell me php.net, I hear that one
 already, and while it is indeed good, I want something in a dead tree
 edition I can canny around and smoke as needed.

 --
 end

 Very Truly yours,
                 - Kirk Bailey,
                   Largo Florida

                       kniht
                      +-+
                      | BOX |
                      +-+
                       think


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



I had great success with Wrox PHP Programming and PHP Essentials by
Julie C. Meloni

The latter is dated, but was clearly written.



-- 

Bastien

Cat, the other other white meat

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] 'Mobile' PHP

2011-09-23 Thread Bastien


On 2011-09-23, at 4:27 AM, Lester Caine les...@lsces.co.uk wrote:

 OK, I can see 'PHP for Android' which seems to have stalled, and I've been 
 playing with other options, but I'm not currently happy with any of this 
 'mobile' stuff.
 
 The 'problem' is quite simple ... While mobile broadband might work in some 
 quite limited areas of the UK - like in bigger towns - it's reliability even 
 in smaller towns is simply getting worse! So a number of my customers have 
 been asking me to provide a backup system which is working fine on laptops, 
 but these are a little cumbersome when the guys have to work away from the 
 vehicles. Tablets via broadband work ... while one can get a signal ... and 
 in many areas around here even getting a PHONE signal depends on where you 
 stand ... so I need a working local PHP setup which can take over and 
 provided things like access codes and the like while out of range, and update 
 the main database when back in range.
 
 Android, mobile windows and the like currently seem very restrictive when it 
 comes to this type of development, so has anybody got any ideas on how to 
 proceed? I though that Android was essentially a strangled version of Linux, 
 so it should be able to run any Linux application?
 
 -- 
 Lester Caine - G8HFL
 -
 Contact - http://lsces.co.uk/wiki/?page=contact
 L.S.Caine Electronic Services - http://lsces.co.uk
 EnquirySolve - http://enquirysolve.com/
 Model Engineers Digital Workshop - http://medw.co.uk//
 Firebird - http://www.firebirdsql.org/index.php
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

Depending in what has to be done, could you use HTML5 with local storage and 
sync back up later? 

AFAIK android runs java programs using a custom JVM.  So any app on those 
devices will need to run in java. Not sure that you couldn't port the php 
engine to that, and it would be an interesting task.

Bastien Koert
905-904-0334
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP installations, usage, and popularity

2011-09-20 Thread Bastien


On 2011-09-20, at 12:05 AM, Tommy Pham tommy...@gmail.com wrote:

 ASP? Not ASP.NET? Wow... I haven't any new sites deployed in ASP in almost
 10 years.  IIRC, ASP is nothing more but bunch of spaghetti codes and no
 OOP.  That's why attendance/registration is so low.  Only main web (server
 side) development languages are ASP.NET (C#), Java, and PHP (listed as
 alphabetical order - not based on demand/popularity).  You'd probably say
 Perl and/or Python too.  IMO, best way to convince the administration is job
 search for ASP under IT category and show them the results vs search for
 PHP ;)  No need for long explanations and comparisons since the point of
 having students certified is that they could get a job quickly.
 
 Best wishes,
 Tommy

Ha, tommy,

My workplace app is classic asp and it sucks! I'll let you decide which sucks 
;-).

It's over 1300 files, and spaghetti isn't the word. It's failure points are so 
many that the pen test tools used created reports of 3000 pages. 

I have been pushing to move to php for years but the geniuses at the top told 
me that php was a 'hobbiest language'. Note this same person told me that we 
were moving to c# because it had the most examples on the msdn network pages. ( 
yes, I know it's an account setting in the msdn network :-) )

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Installing PHP

2011-09-20 Thread Bastien


On 2011-09-19, at 5:32 PM, Mateus Almeida supor...@avanutri.com.br wrote:

 Hello, I'm newbie and I'm trying to install PHP with Apache, but it doesn't
 work. 
 
 Every time I try to run a test I receive the message Not Found The
 requested URL /php/php-cgi.exe/test.php was not found on this server. OR
 (when I try to change some options) Forbidden You don't have permission to
 access /php/php-cgi.exe/test.php on this server.
 
 I've tried to copy the recommended configurations from some sites, but it
 haven't worked. 
 
 The machine runs Windows XP, I'm using an administrator account, no firewall
 is blocking me, PHP and Apache are the most recent versions.
 
 Thanks in advance.
 

The files need to go into the htdocs folder of the apache installation. They do 
no go in the php folder at all. 

You can also set the root directory in the httpd.conf file, the apache config, 
to place the root of the webserver elsewhere in your filesystem

Bastien Koert
905-904-0334
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP installations, usage, and popularity

2011-09-19 Thread Bastien Koert
On Mon, Sep 19, 2011 at 5:08 PM, Tedd Sperling tedd.sperl...@gmail.com wrote:
 Hi gang:

 I need information to convince administrators in management that PHP is a 
 viable subject that should be taught in college with credits going toward a 
 Degree or Certification.

 You see, I am pushing for a Web Development Certification program that would 
 include PHP/MySQL as well as several other Web Languages (i.e., html, css, 
 javascript, ajax).

 Currently the college teaches ASP in a regular course toward a IT 
 Certification, but class attendance has dropped considerably -- no one wants 
 to take the course.

 However, My PHP class has been maxed out. But my class is a special topic 
 class and not part of the regular coursework that would go towards a Degree 
 or Certification -- and that's where I would like this to go.

 As such, I need information regarding how wide-spread PHP is (i.e., number of 
 installations), who's using it (i.e., companies, organizations), and how it 
 compares with other Web Languages (i.e., ASP, Ruby, etc.).

 So, what say you? References will work.

 Thanks,

 tedd

 _
 t...@sperling.com
 http://sperling.com






 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



Ask them if they've heard of

facebook
oracle uses php in the web based admin tool
ibm has a close association with zend and php
microsoft is supporting php natively in win2008 server

Usage stats

http://php.net/usage.php



-- 

Bastien

Cat, the other other white meat

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Episode 2 - All The Cool Kids Use Ruby

2011-09-16 Thread Bastien
That was very funny. A perfect Friday item!

Bastien Koert
905-904-0334

On 2011-09-16, at 2:30 PM, Daevid Vincent dae...@daevid.com wrote:

 http://www.youtube.com/watch?v=5GpOfwbFRcs
 
 LOLercopter

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PhpMyAdmin in EasyPHP cannot run DROP DATABASE

2011-08-25 Thread Bastien


On 2011-08-26, at 12:05 AM, Nam Gi VU nam.gi...@gmail.com wrote:

 Hi Bastien,
 I've create new user but cannot find where to log out to change logged-in 
 user.
 This is strange...
 
 On Thu, Aug 25, 2011 at 12:32 AM, Bastien Koert phps...@gmail.com wrote:
 On Wed, Aug 24, 2011 at 1:30 PM, Nam Gi VU nam.gi...@gmail.com wrote:
  Thanks Bastien for your suggestion.
  Though, I use the `root` account with `All privileges' but it still not
  allowing me to call `drop database'.
  What should I do next?
 
  On Wed, Aug 24, 2011 at 6:25 PM, Bastien phps...@gmail.com wrote:
 
  On 2011-08-23, at 6:44 AM, Nam Gi VU nam.gi...@gmail.com wrote:
 
   Hi every one,
   When trying to run my database script with `drop database` command, the
   server refuse and said as below screenshot.
   What should I do to enable this command?
  
   Regards,
   Nam
  
  
  
 
 
  Check that you phpmyadmin user account has the drop privilege. If not,
  grant that privilege or create another user account that does have more
  privileges
 
  Bastien
 
 
  --
  Nam
 
 
 try creating another user account, that isn't root (always a good
 habit) and giving that account the needed privileges and then
 configure PMA to use that account.
 
 --
 
 Bastien
 
 Cat, the other other white meat
 
 
 
 -- 
 Nam

You don't. Change the config.in.php file to use the new account

Bastien

Re: [PHP] PhpMyAdmin in EasyPHP cannot run DROP DATABASE

2011-08-24 Thread Bastien

On 2011-08-23, at 6:44 AM, Nam Gi VU nam.gi...@gmail.com wrote:

 Hi every one, 
 When trying to run my database script with `drop database` command, the 
 server refuse and said as below screenshot.
 What should I do to enable this command?
 
 Regards,
 Nam
 
 
 


Check that you phpmyadmin user account has the drop privilege. If not, grant 
that privilege or create another user account that does have more privileges

Bastien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



  1   2   3   4   5   6   7   >