php-general Digest 9 Mar 2008 03:18:41 -0000 Issue 5337

Topics (messages 271154 through 271167):

Re: Generating JavaScript menus on-the-fly
        271154 by: tedd
        271163 by: Ken Kixmoeller.com
        271164 by: tedd

Re: Newbie - Undefined Index Variable
        271155 by: tedd

Re: programming and design fees
        271156 by: tedd
        271158 by: Lamp Lists
        271161 by: tedd

Re: send form by email with image spam controler
        271157 by: tedd

Links hierarchy maintenance
        271159 by: Adil Drissi
        271162 by: tedd
        271165 by: Adil Drissi

Re: SOAP PHP 5.2.5 and Outside WSDL's
        271160 by: Larry Garfield

include() and current working directory
        271166 by: php.onsiteupdate.com

Whats faster? simplexml_load_string or simplexml_load_file?
        271167 by: Lamonte

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 ---
At 3:01 PM -0600 3/7/08, Ken Kixmoeller wrote:
Hey - - -- - -- --

I keep a profile of a user's rights and responsibilities in tables. Since this profile defines what a user can do in the system I am designing, I'd like to build a JavaScript menu navigation scheme. I need it to be driven programmatically, because the Admin users can add and remove tasks to the system or to a given user at-will.

I already built a similar thing using CSS-only menus, but it just wasn't aesthetically flexible enough. I am exploring other options, but I am wondering if any of you have done something similar and have any samples or advice.

Ken

Ken:

I use php and css to do navigation. The css handles client-side and php does the server-side.

If you have links that are available for some, but not others and want to keep them secure/private, then don't go the javascript route -- it's a simple matter to break that.

My advice, figure out what you want to present in php and then have php write the css for you.

Cheers,

tedd


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

--- End Message ---
--- Begin Message ---
On Mar 8, 2008, at 9:17 AM, tedd wrote:

At 3:01 PM -0600 3/7/08, Ken Kixmoeller wrote:
Hey - - -- - -- --

I keep a profile of a user's rights and responsibilities in tables. Since this profile defines what a user can do in the system I am designing, I'd like to build a JavaScript menu navigation scheme. I need it to be driven programmatically, because the Admin users can add and remove tasks to the system or to a given user at-will.

I already built a similar thing using CSS-only menus, but it just wasn't aesthetically flexible enough. I am exploring other options, but I am wondering if any of you have done something similar and have any samples or advice.

I use php and css to do navigation. The css handles client-side and php does the server-side.

If you have links that are available for some, but not others and want to keep them secure/private, then don't go the javascript route -- it's a simple matter to break that.

My advice, figure out what you want to present in php and then have php write the css for you.

Hi, tedd --- - - -

Thank you for the advice. I guess I'd better try the CSS route again. I think I may do a combination of CSS and the technique I'm using now.

I appreciate the advice you gave on what is breakable, too. Just to amplify -- the tasks that are available to a user are in a session array. These are created on login (or session init. for a guest user) and only those tasks to which the user has access appear in the array -- links are not just disabled.

Ken

--- End Message ---
--- Begin Message ---
At 1:42 PM -0600 3/8/08, Ken Kixmoeller.com wrote:
On Mar 8, 2008, at 9:17 AM, tedd wrote:

At 3:01 PM -0600 3/7/08, Ken Kixmoeller wrote:
Hey - - -- - -- --

I keep a profile of a user's rights and responsibilities in tables. Since this profile defines what a user can do in the system I am designing, I'd like to build a JavaScript menu navigation scheme. I need it to be driven programmatically, because the Admin users can add and remove tasks to the system or to a given user at-will.

I already built a similar thing using CSS-only menus, but it just wasn't aesthetically flexible enough. I am exploring other options, but I am wondering if any of you have done something similar and have any samples or advice.

I use php and css to do navigation. The css handles client-side and php does the server-side.

If you have links that are available for some, but not others and want to keep them secure/private, then don't go the javascript route -- it's a simple matter to break that.

My advice, figure out what you want to present in php and then have php write the css for you.

Hi, tedd --- - - -

Thank you for the advice. I guess I'd better try the CSS route again. I think I may do a combination of CSS and the technique I'm using now.

I appreciate the advice you gave on what is breakable, too. Just to amplify -- the tasks that are available to a user are in a session array. These are created on login (or session init. for a guest user) and only those tasks to which the user has access appear in the array -- links are not just disabled.

Ken

Ken:

But regardless of the scheme, if you rely upon the user-side of things, then it's insecure.

Cheers,

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

--- End Message ---
--- Begin Message ---
At 11:59 AM -0800 3/7/08, revDAVE wrote:
I have this:

<?php if (trim($_SESSION['nowtoctype']) == 'thistype')

{print '<a href="page1.php">page1</a>';}else{print '<a href="
page2.php">page2</a>';} ?>

I will get the error:

Notice: Undefined index: nowtoctype in ...

If the variable has not yet been defined...

Is there a way to check if this var is already defined? ... (and then I can
define it - if not)

This is something I run into often and here is how I solve it.

        $action = isset($_GET['action']) ? $_GET['action'] : null;
        $action = isset($_POST['action']) ? $_POST['action'] : null;
        $action = isset($_SESSION['action']) ? $_SESSION['action'] : null;

If you expect anything to be provided via GET, POST, or SESSION, then use one of these to initialize it. The null, of course can be changed to whatever default value you want.

Cheers,

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

--- End Message ---
--- Begin Message ---
At 7:06 AM -0800 3/8/08, Lamp Lists wrote:

That's actually part I'm interested the most :D What
is reasonable? Is reasonable for sucha project with
complex product catalog and ordering system  ask $10K?

I think that's reasonable, because I've done similar as you described.

I had one client who wanted a site like art.com (don't look now, because it's screwed) and I submitted a bid of $25k. The client asked "Isn't that a bit high?" and I relied "They paid $400k for their name -- you think they went cheap for the back-end?" I didn't get the job.

I tell clients I charge $50 per hour. Most clients don't mind and hire me.

I had one client say "I never pay more than $25 per hour -- you will accept that?" My answer was "Sure, but it will take me twice as long to do anything."

The point being that hourly wage doesn't really mean anything. Don't judge the value of your work on the time it takes you, but rather on how well your work works.

On most projects, while I make deadlines, I put in many more hours than I bill out. But then again, I love the work.

Cheers,

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

--- End Message ---
--- Begin Message ---
--- tedd <[EMAIL PROTECTED]> wrote:

> At 7:06 AM -0800 3/8/08, Lamp Lists wrote:
> >
> >That's actually part I'm interested the most :D
> What
> >is reasonable? Is reasonable for sucha project with
> >complex product catalog and ordering system  ask
> $10K?
> 
> I think that's reasonable, because I've done similar
> as you described.
> 
> I had one client who wanted a site like art.com
> (don't look now, 
> because it's screwed) and I submitted a bid of $25k.
> The client asked 
> "Isn't that a bit high?" and I relied "They paid
> $400k for their name 
> -- you think they went cheap for the back-end?" I
> didn't get the job.
> 
> I tell clients I charge $50 per hour. Most clients
> don't mind and hire me.
> 
> I had one client say "I never pay more than $25 per
> hour -- you will 
> accept that?" My answer was "Sure, but it will take
> me twice as long 
> to do anything."
> 
> The point being that hourly wage doesn't really mean
> anything. Don't 
> judge the value of your work on the time it takes
> you, but rather on 
> how well your work works.
> 
> On most projects, while I make deadlines, I put in
> many more hours 
> than I bill out. But then again, I love the work.
> 
> Cheers,
> 
> tedd
I needed to hear this :D :D :D
I do not plan to tell the store owner how much hrs I
need and what's my rate. as you said, 100hrs x $50/hr
or 200hrs x $25/hr - it really doesn't matter. I
needed fo myself, to calculate the "worth" of the job.

thanks ted. 
;)

-afan

> -- 
> -------
> http://sperling.com  http://ancientstones.com 
> http://earthstones.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 



--- End Message ---
--- Begin Message ---
At 11:12 AM -0500 3/8/08, Bastien Koert wrote:
The hard part i find is getting the client to scope it out correctly. I started a job last year and it was to be a 10-15 page site to capture some information. So I contracted for $1500. Now its a year later, the client has changed his mind numerous times and the scope has explode out over 100 pages, with all sorts of custom interaction (if this happens send this email, if that happens send another). It has become a real pain and I am definitely not making the $75 / hr i initially scoped.

But as tedd mentioned, I too love the work and it helps be build pieces for future projects

bastien

What we charge and do is not normally discussed on this list. In the past people have said that doing so is price fixing and all sort of other negative comments. But, I don't think discussing what's the going rate and how to get business should be prohibited speech. However, I could be wrong.

In any event, I have one project at the moment that started out at 25 pages and now exceeds 80 -- and these are not static pages. Every page is dynamic and uses up to 20 database extractions to pull out data as needed. None of the pages are simple. Total cost thus far is in the $5-$10k range.

The client said he wanted a simple face-lift for his site, but he did not say that it included numerous expressions. What started as a month project is now almost a year old and continuing in time and cost.

The biggest problem I've faced with this client is that he thinks he "knows" html and the answer is using tables and font tags. It's been maddening to try to get him to understand that his perspective is dated and is costing him more to create an inferior site than to do it right. But, I'm making progress in educating him as to what's possible -- and that's the key.

Normally, I never do a site for less than $1k and that's a static three page. I used to charge $500 for a 3 page and $50 per month for hosting, but that became a pain so I stopped doing that. Now, I just charge per project.

For larger sites ($10k), my design skills are limited - so I recommend hiring a designer for a minimum of $1k per design! So, the costs here in developing a real business site are not trivial. This is not the old "My neighbor's son learned how to do web sites in high school" project but rather a serious means to increase sales.

My job is to put it all together to make it work right -- meaning to be consistent with current technologies (i.e., unobtrusive, validates, accessible, and more more) AND for the site to do what the client wants and more. I have been known to hire other programmers if there is something that I don't understand -- you can't know everything, but be careful how you tell your client that.

The main point here is that most of the work I do is for clients who make money off the net. Most of it is not creating an Internet billboard but rather developing a vehicle to increase sales. Some of my clients have paid as much as $20k for a single Yellow Pages ad, so they understand that you have to put respectable money into advertising. Plus, the Internet is a much wider audience with much greater sales possibilities. I asked one client "Can you handle an expansion to your sales territory?" That actually killed one deal -- they didn't want to expand.

In any event, web sites/applications are more involved than what normally meets the layman's eye. Educating your clients as to what can be can be more important in getting more work than what they think they need. But, that's my perspective.

Cheers,

tedd

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

--- End Message ---
--- Begin Message ---
At 10:08 AM +0100 3/8/08, Alain Roger wrote:
Hi,

i would like to allow web site users to fill a form when they request
information.
the purpose is to have something standardized and later on to archive all
those request into database.
to avoid spammer, i was thinking to use a code image which change to each
page refresh in order to be sure that user is human and not a simple robot
:-)
after that, all data should be sent by web site (maybe a particular email
account or function) to email address [EMAIL PROTECTED]

is there a simple way to do that or a better way ?

moreover where could i find similar example ? especially about image
checking...

Here's a few.

http://webbytedd.com/aa/assorted-captcha/

BUT, all can be broke by a spammer. There is no solution.

So, make it as simple as can be for those who have problems with that sort of thing.

Cheers,

tedd

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

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

I'm working on a site that is becoming more and more
bigger (containing more links). Now the problem of
links maintenance arises. An intuitive idea that i'm
trying to do right know is calling php functions that
will display every part of the site that is
repetitive. For example left side menu and footer. For
the left side menu with static HTML and CSS i'm
disabling the link to the actual page, like that the
user has a visual presentation allowing him to know
where he is exaclty in the site. This introduces more
difficulty for the function that will display the
menu. So i'm wondering if there is some efficient way
of modeling and implementing this.

All suggestions are welcome, and if some part of the
problem is not clear enough please feel free to ask me
more questions if necessary.

Thanks


      
____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping


--- End Message ---
--- Begin Message ---
At 9:23 AM -0800 3/8/08, Adil Drissi wrote:
I'm working on a site that is becoming more and more
bigger (containing more links). Now the problem of
links maintenance arises. An intuitive idea that i'm
trying to do right know is calling php functions that
will display every part of the site that is
repetitive. For example left side menu and footer. For
the left side menu with static HTML and CSS i'm
disabling the link to the actual page, like that the
user has a visual presentation allowing him to know
where he is exaclty in the site. This introduces more
difficulty for the function that will display the
menu. So i'm wondering if there is some efficient way
of modeling and implementing this.

All suggestions are welcome, and if some part of the
problem is not clear enough please feel free to ask me
more questions if necessary.

In all of my pages, I use includes. I have one include for the header, one for the footer and one for the navigation, which is usually called by the header.

If something changes in navigation, I change one file and it's done throughout the site.

Look into includes.

Cheers,

tedd

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

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

Yes this is the correct way to do things. As i said,
i'm using different styles for the menus links
indicating the current page. Suppose my page has one
horiontal menu at the top and one vertical menu at the
left. In this case, one element of the horizontal menu
and one from the vertical menu will be displayed
differently from the other elements. So the function
that will be inluded will be more complex to handle
this. I was just wondering, how other poeple are
dealing with that. Of course it is feasable, but i
want to do it the best way.

I hope the problem i posted is clearer now
 
--- tedd <[EMAIL PROTECTED]> wrote:

> At 9:23 AM -0800 3/8/08, Adil Drissi wrote:
> >I'm working on a site that is becoming more and
> more
> >bigger (containing more links). Now the problem of
> >links maintenance arises. An intuitive idea that
> i'm
> >trying to do right know is calling php functions
> that
> >will display every part of the site that is
> >repetitive. For example left side menu and footer.
> For
> >the left side menu with static HTML and CSS i'm
> >disabling the link to the actual page, like that
> the
> >user has a visual presentation allowing him to know
> >where he is exaclty in the site. This introduces
> more
> >difficulty for the function that will display the
> >menu. So i'm wondering if there is some efficient
> way
> >of modeling and implementing this.
> >
> >All suggestions are welcome, and if some part of
> the
> >problem is not clear enough please feel free to ask
> me
> >more questions if necessary.
> 
> In all of my pages, I use includes. I have one
> include for the 
> header, one for the footer and one for the
> navigation, which is 
> usually called by the header.
> 
> If something changes in navigation, I change one
> file and it's done 
> throughout the site.
> 
> Look into includes.
> 
> Cheers,
> 
> tedd
> 
> -- 
> -------
> http://sperling.com  http://ancientstones.com 
> http://earthstones.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



      
____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs


--- End Message ---
--- Begin Message ---
From your samples below, if what they actually want is that snippet at the 
bottom, then you don't want to send SOAP.  You want to send a REST response, 
vis, "some arbitrary, use-case-specific XML".  In that case, don't use SOAP 
at all but use SimpleXML instead, then dump that to an XML string and send 
it.

If you mean something else, please clarify. :-)

On Wednesday 05 March 2008, Jonathan Pitcher wrote:
> I am connecting to a Third Party WSDL that needs me to turn return an Array
> of results to them. I do and PHP returns this ...
>
>
> <SOAP-ENV:Body>
>     <ns1:addParties>
>         <in0 xsi:type="ns2:AuthenticationInfo">
>             <locale xsi:type="xsd:string">en</locale>
>             <token
> xsi:type="xsd:string">50d3c78a0213b3e083ce7b6c7fa760a299798246fb6bbf1dc2dc8
>1
> 12a841454d5bcb9cb752b18e299cd9be84214175b6c971065d8df08b52283408b925dd85412
>8 5a031ca29c39b945989b951e2523594f5c9c0aa7bbfc328c87441830b47cd0</token>
> <userType xsi:type="xsd:int">1</userType>
>         </in0>
>         <in1 SOAP-ENC:arrayType="ns2:EditConferenceParty[2]"
> xsi:type="ns3:ArrayOf_tns1_EditConferenceParty">
>         <item xsi:type="ns2:EditConferenceParty">
>             <conferenceId xsi:type="xsd:int">163</conferenceId>
>             <phoneNumber xsi:type="xsd:string">9999999999</phoneNumber>
>         </item>
>         <item xsi:type="ns2:EditConferenceParty">
>             <conferenceId xsi:type="xsd:int">163</conferenceId>
>             <phoneNumber xsi:type="xsd:string">9999999999</phoneNumber>
>         </item>
>     </in1>
>     </ns1:addParties>
> </SOAP-ENV:Body>
>
>
> Problem is they need something like:
>
> <EditConference>
>     <conferenceId>163</conferenceId>
>     <phoneNumber>9999999999</ phoneNumber>
> </EditConference>
> <EditConference>
>     <conferenceId>163</conferenceId>
>     <phoneNumber>9999999999</ phoneNumber>
> </EditConference>
>
> I found a good read here that says it deals with the way PHP handles
> outputting arrays.
>
> http://archive.netbsd.se/?ml=soap&a=2006-01&m=1677392
>
> Is this truly considered a bug ? If so has it been resolved in the current
> releases of PHP ?
>
> If not does anyone have a simple solution ?  I can figure out a way to code
> the XML myself and send it but honestly was hoping for a simplier solution
> that didn't envolve writing XML by hand.
>
> Jonathan Pitcher


-- 
Larry Garfield                  AIM: LOLG42
[EMAIL PROTECTED]               ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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

I'm using include to display a html file from a different directory to the current working directory.

This page displays, but is missing all the CSS formating.

I'm assuming this is because it can't find the CSS because it's in the different directory to the CWD.

So, the easy way out is to move the CSS, but I've got heaps of these, and it makes it really messy.

The PHP looks like this:

include("xxx/index.htm");

the css is saved in the xxx folder.

I'm open to any suggestions, ideas?

Many thanks
Matt


--- End Message ---
--- Begin Message --- I was wondering this because at the moment using simplexml_load_file makes my script go at about 2 seconds per page load, in a loop. Then I created a cache system so it doesn't keep loading the xml file, but I'm wondering if theres a faster way to load xml QUICKER, is it possible with "file_get_contents" and "simplexml_load_string" ?
--- End Message ---

Reply via email to