php-general Digest 29 Jan 2009 15:21:30 -0000 Issue 5929

Topics (messages 287351 through 287361):

Re: help with require/includes pathing frustration
        287351 by: Edmund Hertle
        287353 by: Daniel Brown

Re: help with require/includes pathing frustration [SOLVED]
        287352 by: Daevid Vincent
        287354 by: Daniel Brown

Re: New to PHP question
        287355 by: Paul M Foster
        287356 by: Don Collier

PHP 5.3.0beta1
        287357 by: Johannes Schlüter

Rounded rectangle in php
        287358 by: Jônatas Zechim
        287359 by: Greg Bowser
        287361 by: tedd

Re: Making a Variable from different tables with Matching Dbfields?
        287360 by: Terion Miller

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 ---
2009/1/29 Daevid Vincent <dae...@daevid.com>

> At the very top of my login.php page I have this:
>
> <?php
> require_once('./includes/gui/gui_setup.inc.php');
> ...
> ?>
>
> (I've tried with and without the "./" prefix as if that might make a
> difference)
>
> When I try to load the URL:
> https://example.com/vincentd/mydart/login.php
>
> I get this error:
>
> Warning: require_once(./includes/gui/gui_setup.inc.php)
> [function.require-once]: failed to open stream:
> No such file or directory in /home/www/vincentd/mydart/login.php on line
> 2
>
> Fatal error: require_once()
> [function.require]: Failed opening required
> './includes/gui/gui_setup.inc.php'
> (include_path='.:/usr/share/php:/usr/share/pear')
>        in /home/www/vincentd/mydart/login.php on line 2
>
> If I try to access it from the web:
> https://example.com/vincentd/mydart/includes/gui/gui_setup.inc.php
>
> I get a 404:
>
> Not Found
> The requested URL /vincentd/mydart/includes/gui/gui_setup.inc.php was
> not found on this server.
>
> Yet, the file exists.
> [...]
>  -rw-r--r-- 1 vincentd vincentd 1589 2009-01-29 02:44
> includes/gui/gui_setup.php
>
> Doesn't the ".:" in include_path='.:/usr/share/php:/usr/share/pear' mean
> that PHP should look in the current directory (which I assume would be
> "/home/www/vincentd/mydart") as that is where login.php is located?
> And then relative to there it should look in "includes/gui/..." as per
> my require_once command.
>
> What am I not understanding about this?


Well, the name of the file is just: gui_setup.php
but you tried to include: gui_setup.inc.php
Should work without "./"

 -eddy

--- End Message ---
--- Begin Message ---
On Wed, Jan 28, 2009 at 22:15, Daevid Vincent <dae...@daevid.com> wrote:
> At the very top of my login.php page I have this:
>
> <?php
> require_once('./includes/gui/gui_setup.inc.php');
> ...
> ?>
>
> (I've tried with and without the "./" prefix as if that might make a
> difference)

    Not that it will make a difference in this case, but instead of
"./", use something like <?php realpath(dirname(__FILE__)).'/'; ?>

> When I try to load the URL:
> https://example.com/vincentd/mydart/login.php
>
> I get this error:
>
> Warning: require_once(./includes/gui/gui_setup.inc.php)
> [function.require-once]: failed to open stream:
> No such file or directory in /home/www/vincentd/mydart/login.php on line
> 2

    1.) Note the name of the file required here.

> If I try to access it from the web:
> https://example.com/vincentd/mydart/includes/gui/gui_setup.inc.php

    2.) Note the name of the file requested here.

> vince...@pse02 /home/www/vincentd/mydart/includes/gui $ ll
> -rw-rw-rw- 1 vincentd vincentd 11046 2009-01-29 01:17 gui_menu.inc.php
> -rw-r--r-- 1 vincentd vincentd  1589 2009-01-29 02:44 gui_setup.php

    3.) Note the names of the files located here.  ;-P

> Doesn't the ".:" in include_path='.:/usr/share/php:/usr/share/pear' mean
> that PHP should look in the current directory (which I assume would be
> "/home/www/vincentd/mydart") as that is where login.php is located?
> And then relative to there it should look in "includes/gui/..." as per
> my require_once command.

    You are correct, sir.  It's just a typo --- you merged the two
file names into one nonexistent file.

-- 
</Daniel P. Brown>
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

--- End Message ---
--- Begin Message ---
OMFG! I'm an idiot. This is what happens when you work long hours and
refactor code without eating/sleeping properly..

so... it's "gui_setup.inc.php" I'm trying to include, yet the file is
named "gui_setup.php". 

What a newb mistake!!! UGH. Sorry for wasting everyone's bandwidth.
Is there a way to have this email deleted from the archives -- I am
embarrassed by it! HAHAH!

On Wed, 2009-01-28 at 19:15 -0800, Daevid Vincent wrote:

> At the very top of my login.php page I have this:
> 
> <?php
> require_once('./includes/gui/gui_setup.inc.php');
> ...
> ?>
> 
> (I've tried with and without the "./" prefix as if that might make a
> difference)
> 
> When I try to load the URL:
> https://example.com/vincentd/mydart/login.php
> 
> I get this error:
> 
> Warning: require_once(./includes/gui/gui_setup.inc.php) 
> [function.require-once]: failed to open stream: 
> No such file or directory in /home/www/vincentd/mydart/login.php on line
> 2
> 
> Fatal error: require_once() 
> [function.require]: Failed opening required
> './includes/gui/gui_setup.inc.php' 
> (include_path='.:/usr/share/php:/usr/share/pear') 
>       in /home/www/vincentd/mydart/login.php on line 2
> 
> If I try to access it from the web:
> https://example.com/vincentd/mydart/includes/gui/gui_setup.inc.php
> 
> I get a 404:
> 
> Not Found
> The requested URL /vincentd/mydart/includes/gui/gui_setup.inc.php was
> not found on this server.
> 
> Yet, the file exists.
> 
> vince...@pse02 /home/www/vincentd/mydart/includes/gui $ ll
> -rw-rw-rw- 1 vincentd vincentd 11046 2009-01-29 01:17 gui_menu.inc.php
> -rw-r--r-- 1 vincentd vincentd  1589 2009-01-29 02:44 gui_setup.php
> 
> vince...@pse02 /home/www/vincentd/mydart/includes/gui $ ll ../../
> drwxrwxrwx 2 vincentd vincentd    4096 2009-01-28 23:50 css
> -rw-rw-rw- 1 vincentd vincentd    3542 2008-12-29 22:45 favicon.ico
> drwxrwxrwx 5 vincentd vincentd    4096 2009-01-27 00:19 images
> drwxrwxrwx 8 vincentd vincentd    4096 2009-01-08 01:55 includes
> -rw-rw-rw- 1 vincentd vincentd    7556 2009-01-29 02:49 login.php
> -rw-rw-rw- 1 vincentd vincentd   15748 2009-01-14 01:00 my_account.php
> -rw-rw-rw- 1 vincentd vincentd     121 2008-12-31 00:07 phpinfo.php
> -rw-rw-rw- 1 vincentd vincentd   20678 2009-01-29 01:14 template.html
> 
> or put another way (using the same path from the root www dir):
> 
> vince...@pse02 /home/www/vincentd/mydart $ ll
> includes/gui/gui_setup.php 
> -rw-r--r-- 1 vincentd vincentd 1589 2009-01-29 02:44
> includes/gui/gui_setup.php
> 
> Doesn't the ".:" in include_path='.:/usr/share/php:/usr/share/pear' mean
> that PHP should look in the current directory (which I assume would be
> "/home/www/vincentd/mydart") as that is where login.php is located?
> And then relative to there it should look in "includes/gui/..." as per
> my require_once command.
> 
> What am I not understanding about this?



--- End Message ---
--- Begin Message ---
On Wed, Jan 28, 2009 at 22:23, Daevid Vincent <dae...@daevid.com> wrote:
>
> What a newb mistake!!! UGH. Sorry for wasting everyone's bandwidth.
> Is there a way to have this email deleted from the archives -- I am
> embarrassed by it! HAHAH!

    You wish.  Just be glad the PostTrack isn't running right now.
I'd count you so hard that literally ALL your base are belong to us.

-- 
</Daniel P. Brown>
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

--- End Message ---
--- Begin Message ---
On Wed, Jan 28, 2009 at 11:41:31PM +0000, Nathan Rixham wrote:

> Paul M Foster wrote:
>> On Wed, Jan 28, 2009 at 09:26:10PM +0000, Ashley Sheridan wrote:
>>
>> <snip>
>>
>>> I use CSS as much as possible, and it's second nature to me now to
>>> design with CSS rather than tables, but the only area I find it quicker
>>> to use tables is when I design forms. I know I'm going to browser hell,
>>> but meh, I can deal with it! :p
>>
>> That's my problem. Almost all the stuff I do is actual tabular data, or
>> forms. Of course, the header and side bars are built with CSS. But the
>> interior data are usually in tables.
>>
>> I've got forms with 50-odd fields in them, and I completely dispair of
>> trying to make it look as good in CSS as it does in tables. Even with
>> tables, I had more experimenting and colspans than you can imagine.
>>
>> Paul
>>
>
> see this is why i chant "flex flex flex flex flex flex flex flex flex
> flex flex flex flex <drumroll> fleeeexxxxx"

Oh, a proprietary protocol and set of tools meant to run on a
proprietary platform, built by a company as rapacious as Microsoft, and
whose applications can't be mined by search engines?

Oh yeah, I'm there.

Paul


-- 
Paul M. Foster

--- End Message ---
--- Begin Message ---


Paul M Foster wrote:
On Wed, Jan 28, 2009 at 01:45:07PM -0700, Don Collier wrote:

On that note, what would be a better book to learn from?  I have always
been a fan of the O'Reilly books, but I am open to differing flavors of
kool-aid.  One can never have too many resources.

The book that sits on my desk and is incredibly dog-eared is
_Programming PHP_, also from O'Reilly. The whole back section is a
reference on all the PHP functions and some extensions. The front part
of the book explains nearly everything about the language.

There are some errata in the book, which I've pointed out to O'Reilly,
and when in doubt I check the function documentation on the php.net
site.

Paul


I have this "Learning PHP 5" and at the same time bought "PHP and MySQL" also from O'Reilly. Ever since my first "Sed and Awk" book from them about 10 or so years ago I have been hooked. I do have others in my library but I usually give them a shot first to see if I get what I need.

I will have to pick up a copy of the "Programming PHP" and give it a look. Thanks.
--- End Message ---
--- Begin Message ---
Hi,

we have packaged PHP 5.3.0beta1. Source tarballs can be found at 

   http://downloads.php.net/johannes/php-5.3.0beta1.tar.bz2
   ac16e56bf6a4b37ff35d9bc061063a9
   http://downloads.php.net/johannes/php-5.3.0beta1.tar.gz
   71c6c06087cfa9c38567b050d00bcabf

Windows binary builds on

   http://windows.php.net/qa/

Please test it carefully, and report any bugs in the bug system, but  
only if you have a short reproducable test case.

The biggest change is dropping of OO functionality in closures as full
OO support for closures is planed for a later release than PHP 5.3.0.
See http://wiki.php.net/rfc/closures/removal-of-this

This release marks the begin of a feature freeze and bug fix only phase.
If in doubt whether your change is a bugfix please run it by Lukas and
me.

Developers please go through the bug database we have tons of open bugs.
Additionally we have quite a bunch tests failing on non-Linux systems.
Please check whether that are real bugs or system defendant tests.

Users: Now it's certainly the time to check your applications and help
us to identify problems before stable release is done!

Lukas and Johannes


--- End Message ---
--- Begin Message ---
Hi there, is it possible do make a rounded rectangle in php, i can do a
ellipse, but i need a space between the corners, i need to make something
like this:

http://superbrush.files.wordpress.com/2008/03/086.jpg

not the color and the shadows, only the form.


zechim


--- End Message ---
--- Begin Message ---
It is certainly possible, but to my knowledge, there is no built-in method
for doing so.

After a quick Google, it looks like this has been done before:
http://www.assemblysys.com/dataServices/php_roundedCorners.php
http://us3.php.net/manual/en/function.imagefilledrectangle.php#42815


But if you're looking to reinvent the wheel:

1.) Given any three noncolinear points, you can construct a circle. (whose
center is at the intersection of perpendicular bisectors of line segments
connecting these points)
2.) Using imageline(), you can draw the sides of your rectangle, minus the
corners.  At the "empty space" where each corner would be you would  have
the ends of two lines--two points.


3.) Then you need to choose a third point that is "between" those two.
(there is a certain line that the "between" point should lie on)

4.) Once you have three points, you can calculate the center and radius of
the circle that passes through them.  Then use imagearc() to draw the
"rounded corner".


-- Greg


On Thu, Jan 29, 2009 at 8:36 AM, Jônatas Zechim <zechim....@gmail.com>wrote:

> Hi there, is it possible do make a rounded rectangle in php, i can do a
> ellipse, but i need a space between the corners, i need to make something
> like this:
>
> http://superbrush.files.wordpress.com/2008/03/086.jpg
>
> not the color and the shadows, only the form.
>
>
> zechim
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
At 11:36 AM -0200 1/29/09, Jônatas Zechim wrote:
Hi there, is it possible do make a rounded rectangle in php, i can do a
ellipse, but i need a space between the corners, i need to make something
like this:

http://superbrush.files.wordpress.com/2008/03/086.jpg

not the color and the shadows, only the form.

zechim

zechim:

You can draw anything you want, as long as you can describe it via statements.

Here's a simple example:

http://www.webbytedd.com/b4/draw/

Here's rotated text:

http://www.webbytedd.com/b/rotate-text/

Here are some charts:

http://webbytedd.com/ccc/charts/

Keep in mind that these are very simple examples of what can be done.

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
Hi Guys! Well I tried the INNER JOIN and still can not get it to echo the
AdminID so I know it isn't working, (what kind of things should I think
about that could make it not work)  so far the only query that did work and
return the AdminID was my original I believe it was referred to as "hosed"
query, yet then it was explained to me that query while picking up the
AdminID was then returning all the rows from workorders anyways because I
needed the INNER JOIN, so since that isn't working, I'm thinking my best and
fastest route ( I have until Monday on this project and this is just one bit
of it OUCH)  is to use my hosed query then somehow use the resulting AdminID
to fetch the orders from the workorders table, question is , would that be a
sub query, or do I just make the query results for AdminID a variable to use
in another query?
Thanks guys and ps. I'm a she not a he, funny that coders are primarily
always assumed to be guys...lol
Facebook Me: http://www.facebook.com/profile.php?id=1542024891&ref=name

Terion

On Wed, Jan 28, 2009 at 7:39 PM, Shawn McKenzie <nos...@mckenzies.net>wrote:

> Chris wrote:
> >
> >> The main problem is that you've never explained what you want to get
> >> from the query.  The replies have used your code as an example and I'm
> >> pretty sure that's not what you want.  Unless I totally mis-understand
> >> what you want, you have 2 options:
> >>
> >> 1. Use the 2 queries that I gave you in a previous post.
> >> 2. Use a subquery:
> >>
> >> $sql = "SELECT * FROM workorders WHERE AdminID = (SELECT AdminID FROM
> >> admin WHERE UserName = '" .
> >> mysql_real_escape_string($_SESSION['user']) . "')";
> >
> > 3 - fix the join ;)
> >
>
> Yes, however, I'm going out on a limb here because we don't really know
> what he wants - he is only getting admin.AdminID, workorders.AdminID
> returned in all of the queries I've seen.  I'm assuming that he wants
> some of the workorder details.
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---

Reply via email to