Re: can someone help me with this STUPID FUNCTION ISSUE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The code I have been working on can be viewed at 
http://demo.jhaffey.vvhost.us if you feel the need to view it.  There 
is a "System Message" tab towards the bottom.  Inside the graphic is 
an iframe that links to a php file that is suppose to display the 
system msgs put there by the admin.

As for 1500+ lines.....i have run php-nuke and other scripts that 
have 2000+ lines but I have also noticed that if they where to move 
their { up a line or just clean up the code it would be half of that.

Last night I did alot of thinking and figured I would seperate the 
msgformat function from all the rest and see what happens...break the 
problem down so I can divide and conquere (spelled wrong).

--- In php-objects@yahoogroups.com, Ryan Sexton <rsexton@f...> wrote:
> Hi Jason,
> 
> I have multiple files that are +1500 lines and have never 
experienced 
> what you're experiencing on my production machine. You should check 
> your error log. It has happened to me using unstable PHP 
installations. 
> I would get segmentation faults on certain bits of code. The best 
way 
> to debug this is to check your error log, or insert come echo's or 
some 
> debugging information to try and figure out what bit of code is 
killing 
> the script.
> 
> Good luck,
> Ryan
> 
> On Sep 15, 2004, at 2:40 PM, Jason wrote:
> 
> >
> > Andrew,
> >
> > Thank you for the advice.....I will try making the corrections and
> > see what happens. I currently use tsWebEditor 2.0 but I am
> > downloading Zend Studio and will give a shoot.
> >
> > Over the past few years of coding I have noticed something and am
> > wondering if anyone else have noticed this too.  If a PHP file
> > becomes to big, parts are ignored.  I have had PHP files that are 
100
> > to 300 lines long and are solid code and parts of the code (more
> > towards the bottom) start to be dropped off.  Is it possible that 
the
> > server's cache fills up??
> >
> > Jason
> > --- In php-objects@yahoogroups.com, "Andy Bartel" <andy@m...> 
wrote:
> >> Jason,
> >>
> >> I doubt this is the issue, most likely just a miss when you put 
it
> > in
> >> the email, but you're not closing your quotes in your actual 
script
> > or
> >> ending with a semicolon on the first line when you first set
> > $sys_msg.
> >>
> >> Second, your function parse errors because you close the bracket
> > after
> >> you run the first str_replace function rather than letting it
> > continue.
> >> Again this may be an issue with copying your code to the email.
> >>
> >> Third, there's no need for semi colons after bracket closes.
> >>
> >> I added an echo statement and fixed the errors I mentioned and it
> > runs
> >> flawlessly, try this:
> >>
> >> <?
> >>
> >> function msgformat ($msg)
> >> {
> >>   ($debug==true?"msgformat function called<br>":"");
> >>   $msg=str_replace("|NL|","<br>\n",$msg); //SET FOR NEW LINE
> >>   //Check for Date
> >>   if(strstr($msg,"|+D|")!=""){
> >>      $msg=str_replace("|+D|","<sub>",$msg); //TURN ON SUB FOR 
DATE
> >>      $msg=str_replace("|-D|","</sub>",$msg); //TURN OFF SUB FOR 
DATE
> >>   }
> >>   return $msg;
> >> }
> >>
> >> $sys_msg="DEMO LOGINS|+D|(9/12/04)|-D||NL|";
> >> $sys_msg = msgformat($sys_msg);
> >>
> >> echo $sys_msg;
> >>
> >> ?>
> >>
> >> It returns:
> >>
> >> DEMO LOGINS(9/12/04) with the date "subbed".
> >>
> >> I'm not sure which editing program you're using, but my Zend 
Studio
> >> picked up the error right away, you might want to consider 
switching
> >> apps.  If none of the things I said above work, check your 
include
> > path,
> >> php version, etc.
> >>
> >> Good luck,
> >>
> >> -Andrew Bartel
> >> Web Applications Engineer
> >> Modulus, LLC
> >>
> >> -----Original Message-----
> >> From: Jason [mailto:jason@h...]
> >> Sent: Tuesday, September 14, 2004 7:38 PM
> >> To: php-objects@yahoogroups.com
> >> Subject:  can someone help me with this STUPID 
FUNCTION
> >> ISSUE
> >>
> >> my code:
> >> //ON ONE PAGE
> >> <?php
> >> include ("includes/functions.php");
> >> $sys_msg="DEMO LOGINS|+D|(9/12/04)|-D||NL|
> >> $sys_msg = msgformat($sys_msg);
> >> ?>
> >>
> >> //IN ANOTHER PHP FILE
> >> function msgformat ($msg)
> >> {
> >>   ($debug==true?"msgformat function called<br>":"");
> >>   $msg=str_replace("|NL|","<br>\n",$msg); //SET FOR NEW LINE
> >>   };
> >>   //Check for Date
> >>   if(strstr($msg,"|+D|")!=""){
> >>      $msg=str_replace("|+D|","<sub>",$msg); //TURN ON SUB FOR 
DATE
> >>      $msg=str_replace("|-D|","</sub>",$msg); //TURN OFF SUB FOR 
DATE
> >>   };
> >>   return $msg;
> >> };
> >> ....................................................
> >>
> >> Now here is the problem.....nothing is happening.
> >> I have error_reporting on and am not getting any errors of any
> > kind.
> >> My php editing program, which checks for PHP errors and syntx
> >> problems doesnt detect any issues.  My script knows that the
> > function
> >> exists and I think it calls to it but then it dies before 
running a
> >> single line of code.
> >>
> >> $sys_msg = msgformat($sys_msg);
> >> The above is returning NULL.
> >>
> >> Any advice or help would be appreciated
> >>
> >>
> >>
> >>
> >>
> >> PHP Data object relational mapping generator -
> >> http://www.meta-language.net/
> >> Yahoo! Groups Links
> >
> >
> >
> >
> > PHP Data object relational mapping generator - 
> > http://www.meta-language.net/
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
> >



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

PHP Data object relational mapping generator - http://www.meta-language.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux