php-general Digest 12 Mar 2010 17:52:38 -0000 Issue 6635

Topics (messages 302736 through 302750):

Re: PHP MySQL Insert Statements
        302736 by: Kevin Kinsey

Doing dynamic routing for an office
        302737 by: Ian
        302738 by: Per Jessen

mysqli procedural calls and manual entries ?
        302739 by: Per Jessen
        302746 by: Daniel Brown
        302747 by: Per Jessen

how to upload large file ( bigger than 1G) with PHP
        302740 by: ¶ÅÔ½
        302741 by: vikash.iitb.gmail.com
        302743 by: Rene Veerman
        302744 by: Devendra Jadhav
        302745 by: Ashley Sheridan

headers help
        302742 by: MEM
        302750 by: Nathan Rixham

Re: Object Oriented Programming question
        302748 by: Andrew Brookins
        302749 by: Ashley Sheridan

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Martine Osias wrote:
Hi,

My insert statements on this web page don't execute. The select statements do work. This tells me that the database connection is working. The username and password are the administrator's. What else could prevent the insert statements from executing?

Thank you.


Martine


Should be trivial to find out what's happening.  Something
like:

$success=mysql_query($insert_statement) or die("Uh-oh, mysql 
said:".mysql.error());


HTH,

Kevin Kinsey

--- End Message ---
--- Begin Message ---
Hi,

I have had a weird request as a project and that is to build a system where
the clients can put down their office plans into a system and based on where
you are in the buliding (either via defined kiosks or mobile dropdown
filters) it will print out directions on how to get somewhere within that
building. Now, to do it from a fixed location is okay - that could just be a
manual input for each building, but for the variable start point I have no
idea how to do it.

To explain in another way:
* You enter one of the clients offices - you walk up to the touch screen
kiosk and say you are looking to go to Mr Awesomes office. The system then
says, okay - head to the elevators on your right, go to the eighth floor,
turn right walk to the end of the passage and the office is on your left.
This part is easy - the following isnt.
* You are new to the company. You are having a smoke break in a smoking room
and remember you have a meeting. You logon to a mobile site from your phone
(or from your workstation) and you are presented with some filtering options
to pin point where you are (since we cant use GPS here), you then again say
you need to go to Mr Awesomes offices and the system works out that you need
to exit the smoking room left, second passage way right, first left, into
the elevators, up 2 floors, right out the elevators and walk to the end of
the passage and office is on your left.

Any ideas how I could do this easily? The front end isnt a problem, its the
processing behind it actually working out the route. Hope my description is
clear enough and sorry if this has been discussed before - I have no idea
what to search for :)

Thanks
Ian

--- End Message ---
--- Begin Message ---
Ian wrote:

> Hi,
> 
> I have had a weird request as a project and that is to build a system
> where the clients can put down their office plans into a system and
> based on where you are in the buliding (either via defined kiosks or
> mobile dropdown filters) it will print out directions on how to get
> somewhere within that building. Now, to do it from a fixed location is
> okay - that could just be a manual input for each building, but for
> the variable start point I have no idea how to do it.

I don't know exactly where to go and look, but such mapping systems are
very common these days (think GPS navigation systems etc), so the
algorithms involved must be equally well known and -documented. 

/Per

-- 
Per Jessen, Zürich (-1.7°C)


--- End Message ---
--- Begin Message ---
I run a local mirror of the PHP manual, and I most often go straight to
the "Search for" box to look up the format of a function.  With the
mysqli functions, I've found than many of them simply
aren't "available" that way.  E.g. mysqli_connect() - "Sorry, but the
function mysqli_connect  is not in the online manual.".  

Would it be a lot of effort to create function manual entries for the
procedural style of mysqli_*? 


/Per

-- 
Per Jessen, Zürich (-1.4°C)


--- End Message ---
--- Begin Message ---
On Fri, Mar 12, 2010 at 02:49, Per Jessen <p...@computer.org> wrote:
> I run a local mirror of the PHP manual, and I most often go straight to
> the "Search for" box to look up the format of a function.  With the
> mysqli functions, I've found than many of them simply
> aren't "available" that way.  E.g. mysqli_connect() - "Sorry, but the
> function mysqli_connect  is not in the online manual.".
>
> Would it be a lot of effort to create function manual entries for the
> procedural style of mysqli_*?

    Actually, Per, they do exist.... it's a problem with the manual
error-router itself.  I'll take a look at that again today.  It's been
forgotten for years, for some reason.  I'll let you know if/when
there's a solution.... hopefully I can get to it and finish it today.

    In the meantime, you can find the XML sources for those on your
local mirror in {$MIRROR_ROOT}/reference/mysqli/ and it's children.
Specifically for mysqli_connect(), see
{$MIRROR_ROOT}/reference/mysqli/mysqli/connect.xml .

-- 
</Daniel P. Brown>
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Looking for hosting or dedicated servers?  Ask me how we can fit your budget!

--- End Message ---
--- Begin Message ---
Daniel Brown wrote:

> On Fri, Mar 12, 2010 at 02:49, Per Jessen <p...@computer.org> wrote:
>> I run a local mirror of the PHP manual, and I most often go straight
>> to the "Search for" box to look up the format of a function.  With
>> the mysqli functions, I've found than many of them simply
>> aren't "available" that way.  E.g. mysqli_connect() - "Sorry, but the
>> function mysqli_connect  is not in the online manual.".
>>
>> Would it be a lot of effort to create function manual entries for the
>> procedural style of mysqli_*?
> 
>     Actually, Per, they do exist.... it's a problem with the manual
> error-router itself.  I'll take a look at that again today. 

Hi Daniel

That's what I thougfht too, but I wasn't sure.  The pages are clearly
there, e.g.:

http://php/manual/en/mysqli.connect.php

> It's been forgotten for years, for some reason.  I'll let you know
> if/when there's a solution.... hopefully I can get to it and finish it
> today. 

Cool, thanks.


/Per
-- 
Per Jessen, Zürich (1.8°C)


--- End Message ---
--- Begin Message ---
hello, guys,

I have tried many ways and was told to use C or Perl. Perl is a stranger to
me and I never use C in a project.
Is there anybody would tell me how to make php interact with C/Perl and how
to maintain sessions during the interacting time ?

thanks in advance!

--- End Message ---
--- Begin Message ---
Hi,

You can always change php.ini settings to allow larger file uploads.

*upload_max_filesize = 2M*

Increase it to fit your need. You may need to change this as well:

*post_max_size = 10M
*
Let me know if it works for you. :)

--
Regards,
Vikash Kumar
--
http://vika.sh


On Fri, Mar 12, 2010 at 1:39 PM, 杜越 <ooooo...@gmail.com> wrote:

> hello, guys,
>
> I have tried many ways and was told to use C or Perl. Perl is a stranger to
> me and I never use C in a project.
> Is there anybody would tell me how to make php interact with C/Perl and how
> to maintain sessions during the interacting time ?
>
> thanks in advance!
>

--- End Message ---
--- Begin Message ---
try http://jumploader.com/

it's java+php, and free.


On Fri, Mar 12, 2010 at 9:09 AM, 杜越 <ooooo...@gmail.com> wrote:
> hello, guys,
>
> I have tried many ways and was told to use C or Perl. Perl is a stranger to
> me and I never use C in a project.
> Is there anybody would tell me how to make php interact with C/Perl and how
> to maintain sessions during the interacting time ?
>
> thanks in advance!
>

--- End Message ---
--- Begin Message ---
Always prefer FTP for large file uploads.

On Fri, Mar 12, 2010 at 3:38 PM, Rene Veerman <rene7...@gmail.com> wrote:

> try http://jumploader.com/
>
> it's java+php, and free.
>
>
> On Fri, Mar 12, 2010 at 9:09 AM, 杜越 <ooooo...@gmail.com> wrote:
> > hello, guys,
> >
> > I have tried many ways and was told to use C or Perl. Perl is a stranger
> to
> > me and I never use C in a project.
> > Is there anybody would tell me how to make php interact with C/Perl and
> how
> > to maintain sessions during the interacting time ?
> >
> > thanks in advance!
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Devendra Jadhav
देवेंद्र जाधव

--- End Message ---
--- Begin Message ---
On Fri, 2010-03-12 at 18:11 +0530, Devendra Jadhav wrote:

> Always prefer FTP for large file uploads.
> 
> On Fri, Mar 12, 2010 at 3:38 PM, Rene Veerman <rene7...@gmail.com> wrote:
> 
> > try http://jumploader.com/
> >
> > it's java+php, and free.
> >
> >
> > On Fri, Mar 12, 2010 at 9:09 AM, 杜越 <ooooo...@gmail.com> wrote:
> > > hello, guys,
> > >
> > > I have tried many ways and was told to use C or Perl. Perl is a stranger
> > to
> > > me and I never use C in a project.
> > > Is there anybody would tell me how to make php interact with C/Perl and
> > how
> > > to maintain sessions during the interacting time ?
> > >
> > > thanks in advance!
> > >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 


I've noticed that large uploads over http seem to behave a little
unpredictably at times, and aren't something I'd rely on. FTP is
definitely the way to go, and there are plenty of Java applets that
allow you to do this.

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



--- End Message ---
--- Begin Message ---
Hello all,

I must confess I know the very basics on this language and have even less
knowledge about http headers. I wish you could help me out on this:

I have a form that sends html e-mails and an optional file as attachment.
The issue is that, if the file is NOT send, the e-mail receives two times
the same content, one that gets read by the mail clients as HTML properly,
and, a literal print of my $message string variable that contains:

<html>
  <head>
  </head>
  <boby>
    <table>My form contents</table>
  </body>
</html>


I believe that the reason for this lies on the $header options, probably on
line number 8 ?

Here is the, what I believe, is the relevant code:

http://pastebin.com/5ywdK0UU


What should I do, to avoid this extra <html> code on the e-mail messages ?



Thanks in advance,
Márcio

--- End Message ---
--- Begin Message ---
MEM wrote:
> Hello all,
> 
> I must confess I know the very basics on this language and have even less
> knowledge about http headers. I wish you could help me out on this:

mime headers not http :)

> I have a form that sends html e-mails and an optional file as attachment.
> The issue is that, if the file is NOT send, the e-mail receives two times
> the same content, one that gets read by the mail clients as HTML properly,
> and, a literal print of my $message string variable that contains:
> 
> <html>
>   <head>
>   </head>
>   <boby>
>     <table>My form contents</table>
>   </body>
> </html>
> 
> 
> I believe that the reason for this lies on the $header options, probably on
> line number 8 ?
> 
> Here is the, what I believe, is the relevant code:
> 
> http://pastebin.com/5ywdK0UU

I've had a quick look and this: http://pastebin.com/RswEBPLd may work;
if not though you want to view the source of an email from anywhere
which displays correctly; and the source of one from your application -
then compare to get the fix :)

Regards!

--- End Message ---
--- Begin Message ---
On Tue, Jan 19, 2010 at 7:11 AM, Ben Stones <b3n...@googlemail.com> wrote:
> Hi,
>
> I've been learning about object oriented programming for the past few weeks
> and I've understood it pretty well, but I have one question. Usually with
> PHP scripts I make, all the functionality for a specific page is in the
> actual PHP file, and I'd use PHP functions in a separate directory which
> would be included in whichever PHP file needs specific functions I have
> created. The functions would be for the specific things in my script, such
> as validation checks, functionality that will be used/repeated a lot
> throughout my script, etc. What I don't understand about OOP is what its
> primary purpose is for. Do I use OOP for all the functionality of my
> application, in separate directories, and include these specific class files
> and call the methods to complete specific functionality needed for whatever
> PHP file I'm working on, or is OOP used for specific functionality like I
> would with functions? Essentially what I'm asking is what is the primary
> purpose for OOP? Hope you understand.
>
> Thanks,
>

Hey, Ben,

The primary purpose of object-oriented programming is to make code
easier to maintain.

Typically moving to an OO approach means designing your scripts with
objects in mind from the ground up.  You might find it helpful to
start fresh with a new project and try to write it all with classes
and methods.  This can be a challenge, depending on how long you have
been programming without objects.

I recommend that you find some open-source, object-oriented scripts
similar to ones you have worked on in the past and read through the
code to see how it's done.  An object-oriented framework like
CodeIgniter can help get you on the right track, though there are also
pitfalls with using frameworks.  Watch out for over-complex frameworks
that will only confuse you.

Also, there are a lot of poorly-written and/or non-OO PHP scripts
floating around out there, so it might help to read OO code written in
Python, Ruby, or some other scripting language.  I have found that in
general, the quality of publicly available work is higher in those two
languages than in PHP.

Andrew

--- End Message ---
--- Begin Message ---
On Fri, 2010-03-12 at 06:49 -0800, Andrew Brookins wrote:

> On Tue, Jan 19, 2010 at 7:11 AM, Ben Stones <b3n...@googlemail.com> wrote:
> > Hi,
> >
> > I've been learning about object oriented programming for the past few weeks
> > and I've understood it pretty well, but I have one question. Usually with
> > PHP scripts I make, all the functionality for a specific page is in the
> > actual PHP file, and I'd use PHP functions in a separate directory which
> > would be included in whichever PHP file needs specific functions I have
> > created. The functions would be for the specific things in my script, such
> > as validation checks, functionality that will be used/repeated a lot
> > throughout my script, etc. What I don't understand about OOP is what its
> > primary purpose is for. Do I use OOP for all the functionality of my
> > application, in separate directories, and include these specific class files
> > and call the methods to complete specific functionality needed for whatever
> > PHP file I'm working on, or is OOP used for specific functionality like I
> > would with functions? Essentially what I'm asking is what is the primary
> > purpose for OOP? Hope you understand.
> >
> > Thanks,
> >
> 
> Hey, Ben,
> 
> The primary purpose of object-oriented programming is to make code
> easier to maintain.
> 
> Typically moving to an OO approach means designing your scripts with
> objects in mind from the ground up.  You might find it helpful to
> start fresh with a new project and try to write it all with classes
> and methods.  This can be a challenge, depending on how long you have
> been programming without objects.
> 
> I recommend that you find some open-source, object-oriented scripts
> similar to ones you have worked on in the past and read through the
> code to see how it's done.  An object-oriented framework like
> CodeIgniter can help get you on the right track, though there are also
> pitfalls with using frameworks.  Watch out for over-complex frameworks
> that will only confuse you.
> 
> Also, there are a lot of poorly-written and/or non-OO PHP scripts
> floating around out there, so it might help to read OO code written in
> Python, Ruby, or some other scripting language.  I have found that in
> general, the quality of publicly available work is higher in those two
> languages than in PHP.
> 
> Andrew
> 


I'd just like to add my own thoughts on OOP.

Whereas with conventional procedural PHP you might put your functions
outside in a separate file to be called whenever you need them, going
the OOP route allows you to section out your functions into groups as it
were.

Imagine a company site selling products and support online. You might
have an object to deal with the logins, shopping cart and shopping
history, another object for dealing with the blog/forum where you
support is given, maybe another for pulling the general content of the
page together. This would allow you to only load in those bits you need
on each part of the site and re-use specific parts on other sites
easily.

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



--- End Message ---

Reply via email to