php-general Digest 14 Oct 2011 11:08:56 -0000 Issue 7519

Topics (messages 315289 through 315296):

Re: Compile PHP with MySQLi (With MySQL on a remote server)
        315289 by: Nilesh Govindarajan

Processing newlines in a text area field
        315290 by: Stephen
        315292 by: Jason Pruim
        315294 by: David Robley

Re: Introducting CRUDsader : a new PHP ORM Framework
        315291 by: Sharl.Jimh.Tsin
        315296 by: jean-baptiste verrey

Re: Compile PHP with MySQL support
        315293 by: Sharl.Jimh.Tsin

Re: files outside of documentRoot
        315295 by: Ricardo Martinez

Administrivia:

To subscribe to the digest, e-mail:
        [email protected]

To unsubscribe from the digest, e-mail:
        [email protected]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
On 10/13/2011 06:57 PM, Nick Khamis wrote:
> Hello Nilesh,
> 
> Thank you so much for your response. I have been stuck on this for two
> days. As mentioned earlier
> we compiled PHP with the "--with-mysqli" directive however there is no
> mysql/i.o to be found anywhere
> on the system. And thus we are recieving the "fatal call to undefined
> function mysql_connect()" error.
> As for the mysql native library, I am guessing it's no longer included
> in the php tree for copyright reasons?
> 
> Thanks in Advance,
> 
> Nick.
> 
> On Thu, Oct 13, 2011 at 9:13 AM, Nilesh Govindarajan
> <[email protected] <mailto:[email protected]>> wrote:
> 
>     On 10/13/2011 05:59 PM, Nick Khamis wrote:
>     > Hello Everyone,
>     >
>     > I am trying to compile php from source using the following config:
>     >
>     > ./configure --prefix=/usr/local/php
>     > --with-apxs2=/usr/local/
>     > apache/bin/apxs
>     > --with-config-file-path=/usr/local/php
>     > --with-mcrypt=/usr/local/bin/mcrypt --with-mysqli
>     > --with-gettext=./ext/gettext --with-pear
>     > --with-libxml-dir=/usr/include/libxml2 --with-zlib --with-gd
>     > --enable-pcntl
>     >
>     > Note the mysqli without pointing to /usr/local/mysql/bin/mysql_config.
>     > The problem is MySQL is not installed on the machine, it is actually
>     > installed on another server.
>     >
>     > MySQLi Suport:
>     >
>     > mysqli
>     > MysqlI Support  enabled
>     > Client API library version      5.1.49
>     > Active Persistent Links         0
>     > Inactive Persistent Links       0
>     > Active Links    0
>     > Client API header version       5.1.49
>     > MYSQLI_SOCKET   /var/run/mysqld/mysqld.sock
>     >
>     > Directive       Local Value     Master Value
>     > mysqli.allow_local_infile       On      On
>     > mysqli.allow_persistent On      On
>     > mysqli.default_host     no value        no value
>     > mysqli.default_port     3306    3306
>     > mysqli.default_pw       no value        no value
>     > mysqli.default_socket   no value        no value
>     > mysqli.default_user     no value        no value
>     > mysqli.max_links        Unlimited       Unlimited
>     > mysqli.max_persistent   Unlimited       Unlimited
>     > mysqli.reconnect        Off     Off
>     >
>     > The machine I compiled PHP on does not have mysqli.so, and so I am
>     > recieving the "fatal call to undefined function mysql_connect()"
>     > error. Can someone tell me how to compile php from source with mysql
>     > support, but actually mysql is installed on a different server?
>     >
>     > Can I download a precompile mysqli anywhere? The PHP version is 5.1.49
>     > as noted earlier.
>     >
>     > Thanks in Advance,
>     >
>     > Nick
>     >
> 
>     You don't need the mysql server to compile mysql{,i} modules, the client
>     library is enough.
>     Any special reason for not using mysqlnd, which will compile without
>     needing the mysql client library? Or I guess it's not there in php 5.1
> 
>     --
>     Nilesh Govindarajan
>     http://nileshgr.com
> 
>     --
>     PHP General Mailing List (http://www.php.net/)
>     To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

MySQLND is included in the PHP tree, MySQLND has no copyright issues. I
use that on all my servers, I use php 5.3 though. Don't know if 5.1 has it.

-- 
Nilesh Govindarajan
http://nileshgr.com

--- End Message ---
--- Begin Message ---
I have a web page with a form with a text area. I enter:

foo


bar

PHP processes the POST and inserts the record into MySQL.

The database field is text.

I use PDO

For testing I have removed any processing of the text area content.

Now, no matter how many blank rows I have between foo and bar, in the database record, I always get a single newline character.

I am using Firefox 7.0.1.

Is this normal behaviour? I want to be able to enter more than 1 newline.

Thanks
Stephen

--- End Message ---
--- Begin Message ---
Answer below!


Jason Pruim
[email protected]



On Oct 13, 2011, at 10:49 PM, Stephen wrote:

> I have a web page with a form with a text area. I enter:
> 
> foo
> 
> 
> bar
> 
> PHP processes the POST and inserts the record into MySQL.
> 
> The database field is text.
> 
> I use PDO
> 
> For testing I have removed any processing of the text area content.
> 
> Now, no matter how many blank rows I have between foo and bar, in the 
> database record, I always get a single newline character.
> 
> I am using Firefox 7.0.1.
> 
> Is this normal behaviour? I want to be able to enter more than 1 newline.

It could possibly be just not displaying it properly in the webpage... try 
running the output through: nl2br(); and see if that helps.


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


--- End Message ---
--- Begin Message ---
Stephen wrote:

> I have a web page with a form with a text area. I enter:
> 
> foo
> 
> 
> bar
> 
> PHP processes the POST and inserts the record into MySQL.
> 
> The database field is text.
> 
> I use PDO
> 
> For testing I have removed any processing of the text area content.
> 
> Now, no matter how many blank rows I have between foo and bar, in the
> database record, I always get a single newline character.
> 
> I am using Firefox 7.0.1.
> 
> Is this normal behaviour? I want to be able to enter more than 1 newline.
> 
> Thanks
> Stephen

You may have forgotten that HTML treats all whitespace, such as tabs,
newlines and spaces, as a space, unless you wrap the text in PRE tags.

To display a line break where your text contains EOL characters, use nl2br()



Cheers
-- 
David Robley

Hm..what's this red button fo:=/07<NO CARRIER
Today is Boomtime, the 68th day of Bureaucracy in the YOLD 3177. 


--- End Message ---
--- Begin Message ---
在 2011-10-13四的 19:06 +0100,jean-baptiste verrey写道:
> hi everyone,
> 
> I have been developing an ORM framework for the last year (at least) and I
> have finally released a beta that is worth of being on internet^^
> so if you have some time to spare have a look at http://www.crudsader.com/.
> 
> The novelty of the framework lies in object automatic forms, configuration
> and the Object query language (which is very simple and uses string instead
> of object methods).
> It's missing cache and performance improvement at the moment but I'm working
> on it.
> 
> I will gladly appreciate any comments to make it better, or about anything
> that the framework is missing or where I could have been completely wrong!
> 
> Regards,
> 
> Jean-Baptiste Verrey
> 
> ps: I'm working hard on checking that the examples of the doc are actually
> working, and to add more content to the docs

Great job,thanks a lot.is it open source?

-- 
Best regards,
Sharl.Jimh.Tsin (From China **Obviously Taiwan INCLUDED**)

Using Gmail? Please read this important notice:
http://www.fsf.org/campaigns/jstrap/gmail?10073.

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---
--- Begin Message ---
yes it's open source, it's under LGPL license!

On 14 October 2011 03:52, Sharl.Jimh.Tsin <[email protected]> wrote:

> 在 2011-10-13四的 19:06 +0100,jean-baptiste verrey写道:
> > hi everyone,
> >
> > I have been developing an ORM framework for the last year (at least) and
> I
> > have finally released a beta that is worth of being on internet^^
> > so if you have some time to spare have a look at
> http://www.crudsader.com/.
> >
> > The novelty of the framework lies in object automatic forms,
> configuration
> > and the Object query language (which is very simple and uses string
> instead
> > of object methods).
> > It's missing cache and performance improvement at the moment but I'm
> working
> > on it.
> >
> > I will gladly appreciate any comments to make it better, or about
> anything
> > that the framework is missing or where I could have been completely
> wrong!
> >
> > Regards,
> >
> > Jean-Baptiste Verrey
> >
> > ps: I'm working hard on checking that the examples of the doc are
> actually
> > working, and to add more content to the docs
>
> Great job,thanks a lot.is it open source?
>
> --
> Best regards,
> Sharl.Jimh.Tsin (From China **Obviously Taiwan INCLUDED**)
>
> Using Gmail? Please read this important notice:
> http://www.fsf.org/campaigns/jstrap/gmail?10073.
>

--- End Message ---
--- Begin Message ---
在 2011-10-13四的 08:27 -0400,Nick Khamis写道:
> Hello Everyone,
> 
> I am trying to compile php from source using the following config:
> 
> ./configure --prefix=/usr/local/php
> --with-apxs2=/usr/local/apache/bin/apxs
> --with-config-file-path=/usr/local/php
> --with-mcrypt=/usr/local/bin/mcrypt --with-mysqli
> --with-gettext=./ext/gettext --with-pear
> --with-libxml-dir=/usr/include/libxml2 --with-zlib --with-gd
> --enable-pcntl
> 
> Note the mysqli without pointing to /usr/local/mysql/bin/mysql_config.
> The problem is MySQL is not installed on the machine, it is actually
> installed on another server.
> 
> MySQLi Suport:
> 
> mysqli
> MysqlI Support  enabled
> Client API library version      5.1.49
> Active Persistent Links         0
> Inactive Persistent Links       0
> Active Links    0
> Client API header version       5.1.49
> MYSQLI_SOCKET   /var/run/mysqld/mysqld.sock
> 
> Directive       Local Value     Master Value
> mysqli.allow_local_infile       On      On
> mysqli.allow_persistent On      On
> mysqli.default_host     no value        no value
> mysqli.default_port     3306    3306
> mysqli.default_pw       no value        no value
> mysqli.default_socket   no value        no value
> mysqli.default_user     no value        no value
> mysqli.max_links        Unlimited       Unlimited
> mysqli.max_persistent   Unlimited       Unlimited
> mysqli.reconnect        Off     Off
> 
> The machine I compiled PHP on does not have mysqli.so, and so I am
> recieving the "fatal call to undefined function mysql_connect()"
> error. Can someone tell me how to compile php from source with mysql
> support, but actually mysql is installed on a different server?

install it locally.otherwise impossible.

> 
> Can I download a precompile mysqli anywhere? The PHP version is 5.1.49
> as noted earlier.
> 
> Thanks in Advance,
> 
> Nick

-- 
Best regards,
Sharl.Jimh.Tsin (From China **Obviously Taiwan INCLUDED**)

Using Gmail? Please read this important notice:
http://www.fsf.org/campaigns/jstrap/gmail?10073.

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---
--- Begin Message ---
Mmm i'm trying to show a .flv but i dont know if i'm using the correct
headers and method.

$name = $file;
$fp = fopen($name, 'rb');

// send the right headers
header("Content-Type: video/x-flv");
header("Content-Length: " . filesize($name));

// dump the picture and stop the script
fpassthru($fp);
exit;

i'm getting all time the player black.

all idea are welcome!!! :)

thx!!!

On Wed, Oct 12, 2011 at 12:46 PM, Ricardo Martinez <[email protected]>wrote:

> It works thx a lot =)
>
>
>
> On Tue, Oct 11, 2011 at 5:26 PM, Bastien Koert <[email protected]> wrote:
>
>> On Tue, Oct 11, 2011 at 11:00 AM, Ricardo Martinez <[email protected]>
>> 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 <[email protected]
>> >wrote:
>> >
>> >>
>> >> On Sun, Oct 9, 2011 at 9:52 AM, Ricardo Martinez <[email protected]
>> >wrote:
>> >>
>> >>> 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 <[email protected]
>> >>> >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
>>
>
>
>
> --
> Ricardo
> _______________________________________________
> IT Architect
> website: http://www.pulsarinara.com
>



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

--- End Message ---

Reply via email to