php-general Digest 31 May 2008 21:08:06 -0000 Issue 5490
Topics (messages 274892 through 274901):
Class Load twice
274892 by: Yui Hiroaki
274893 by: Ludovic André
274894 by: Yui Hiroaki
274899 by: Brady Mitchell
Re: PHP eg.
274895 by: mukesh yadav
274896 by: Bastien Koert
274900 by: zerof
Re: Update does not work...but no errors either
274897 by: Daniel Brown
Re: phpeclipse debugging & setup
274898 by: Selwyn Polit
274901 by: PJ
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 ---
hi!
Please take look at my code;
I have two files.
one of the two file is wrtten mail() function.
when load.php is loaded, mail(), written by MyClass.php,
os also loaded.
I just do not want to load mail() when load.php is load.
if you know how to solove it, please teach me it!
*********MyClass.php***********
<?php
$objRef=new MyClass("hui7gutWSFrh6zt");
$objRef->buff();
mail("[EMAIL PROTECTED]","test","test");
class MyClass{
Private $google;
function __construct($googleKEY){
$this->google=$googleKEY;
}
public function buff(){
echo $this->google;
}
}
?>
*********MyClass.php***********
<?php
function __autoload($class_name) {
include_once $class_name . '.php';
}
$obj = new MyClass();
?>
Regards,
Yui
--- End Message ---
--- Begin Message ---
Hi,
I just do not want to load mail() when load.php is load.
if you know how to solove it, please teach me it!
I assume that the second file is named 'load.php' ?
Then you should just comment the line starting with mail(... in MyClass.php
So:
*********MyClass.php***********
<?php
$objRef=new MyClass("hui7gutWSFrh6zt");
$objRef->buff();
//mail("[EMAIL PROTECTED]","test","test");
class MyClass{
Private $google;
function __construct($googleKEY){
$this->google=$googleKEY;
}
public function buff(){
echo $this->google;
}
}
?>
That was an easy one ;)
Best regards,
Ludovic André
--- End Message ---
--- Begin Message ---
Yes, Second file is load.php(NOT MyClass.php )
If you add comment Mail() function ,in MyClass.php,
I can not get any email!
I just want to get email from only MyClass.php.
Regards,
Yui
2008/5/31 Ludovic André <[EMAIL PROTECTED]>:
> Hi,
>>
>> I just do not want to load mail() when load.php is load.
>> if you know how to solove it, please teach me it!
>>
>
> I assume that the second file is named 'load.php' ?
> Then you should just comment the line starting with mail(... in MyClass.php
> So:
>
> *********MyClass.php***********
> <?php
> $objRef=new MyClass("hui7gutWSFrh6zt");
> $objRef->buff();
> //mail("[EMAIL PROTECTED]","test","test");
> class MyClass{
> Private $google;
> function __construct($googleKEY){
> $this->google=$googleKEY;
> }
> public function buff(){
> echo $this->google;
> }
> }
>
> ?>
>
> That was an easy one ;)
>
>
> Best regards,
>
> Ludovic André
>
>
--- End Message ---
--- Begin Message ---
On May 31, 2008, at 211AM, Yui Hiroaki wrote:
I just do not want to load mail() when load.php is load.
if you know how to solove it, please teach me it!
*********MyClass.php***********
<?php
$objRef=new MyClass("hui7gutWSFrh6zt");
$objRef->buff();
mail("[EMAIL PROTECTED]","test","test");
class MyClass{
Private $google;
function __construct($googleKEY){
$this->google=$googleKEY;
}
public function buff(){
echo $this->google;
}
}
?>
Because the call to the mail function is outside of the class
definition, it will be executed as soon as the file is included. If
you want the email to be sent by the class, it needs to be done
within one of the class methods (functions).
Brady
--- End Message ---
--- Begin Message ---
hey
thank you guys for your reply and suggestion i really appreciate
it...
now I'm planning to to write a small project. I think it will be a best way
to learn PHP and the stuff how it works.
defiantly this mailing list will provide me great help when ever I'll need.
On Fri, May 30, 2008 at 9:03 PM, Eric Butera <[EMAIL PROTECTED]> wrote:
> On Fri, May 30, 2008 at 2:34 AM, mukesh yadav <[EMAIL PROTECTED]> wrote:
> > Hi,
> > I'm trying to learn a PHP by myself...and i need a help.
> > I have learned all the basic but i dont know how to implement the stuff.
> > Can you please guys help me out give me a small site in PHP so that i can
> > study and learn.
> >
> > thank you.
> >
>
> The way I started was just a desire to know how to make this web thing
> work. So I came up with the idea to make a page that would show some
> current information I've posted and have the ability to
> add/edit/delete this information. Everything else fell in line once I
> had the idea of what I wanted to happen. I had to research pulling
> and putting records into mysql. It was a horrible mess compared to
> what I do now, but you have to get your feet wet somehow.
>
> Find something you want to accomplish. It gives you specific
> requirements and fulfilling them is where you really learn. After you
> complete your project, do another one. Along the way you'll learn
> what does and doesn't work.
>
> The first script I ever really tried to work on was loosely based
> around this article [1]. There are lots of issues I have with the
> code but it is what I started out with. It shows the basics of
> working with mysql and the whole record workflow. Some of the main
> issues I have are:
> - or die() is not error handling
> - no escaping of raw data on output
> - lack of data validation on user input
>
> These issues aren't as important if it is a local pet project. If you
> plan on making this more than a weekend hobby though, please make sure
> to read up on the security side of things also. [2] For a more in
> depth look see the OWASP Guide. [3]
>
> Good luck!
>
> [1] http://www.melonfire.com/community/columns/trog/article.php?id=280
> [2] http://phpsec.org/library/
> [3] http://www.owasp.org/index.php/Guide_Table_of_Contents
>
--- End Message ---
--- Begin Message ---
On 5/31/08, mukesh yadav <[EMAIL PROTECTED]> wrote:
>
> hey
> thank you guys for your reply and suggestion i really appreciate
> it...
> now I'm planning to to write a small project. I think it will be a best way
> to learn PHP and the stuff how it works.
> defiantly this mailing list will provide me great help when ever I'll need.
>
I am so glad you are DEFINITELY defiant ;-)
--
Bastien
Cat, the other other white meat
--- End Message ---
--- Begin Message ---
mukesh yadav escreveu:
Hi,
I'm trying to learn a PHP by myself...and i need a help.
I have learned all the basic but i dont know how to implement the stuff.
Can you please guys help me out give me a small site in PHP so that i can
study and learn.
thank you.
Maybe, this site can help you to learn:
http://www.educar.pro.br/
Apache - PHP - MySQL - Boolean Logics - Project Management
----------------------------------------------------------
Você deve, sempre, consultar uma segunda opinião!
----------------------------------------------------------
Deixe todos saberem se esta informação foi-lhe útil.
----------------------------------------------------------
You must hear, always, one second opinion! In all cases.
----------------------------------------------------------
Let the people know if this info was useful for you!
----------------------------------------------------------
--- End Message ---
--- Begin Message ---
On Sat, May 31, 2008 at 4:23 AM, Ryan S <[EMAIL PROTECTED]> wrote:
>
>
> Hey,
>
> This is my code:
> ==============================================================
> $update_sql="update greetings_final set
> heading='$heading',message='$message',signature='$signature',font_size='$font_size',font_color='$font_color',bg_color='$bg_color'
> where temp_cno='".$thecno."' and rand_string='".$randreference."' LIMIT 5";
> echo $update_sql."<br><br>";
> $result2 = mysql_query($update_sql);
> if(mysql_affected_rows()==0){echo "Error R093d: unable to update
> greeting";exit;}
> ==============================================================
Try this:
<?php
// Shorten sanity for this email.
function m($data) {
$data = mysql_real_escape_string($data);
return $data;
}
$update_sql = "UPDATE greetings_final SET heading='".m($heading)."',";
$update_sql .= "message='".m($message)."',signature='".m($signature)."',";
$update_sql .= "font_size='".m($font_size)."',font_color='".m($font_color)."',";
$update_sql .= "bg_color='".m($bg_color)."' WHERE temp_cno='".m($thecno)."' ";
$update_sql .= "AND rand_string='".m($randreference)."' LIMIT 5";
$result2 = mysql_query($update_sql) or die(mysql_error());
?>
--
</Daniel P. Brown>
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
$59.99/mo. with no contract!
Dedicated servers, VPS, and hosting from $2.50/mo.
--- End Message ---
--- Begin Message ---
I also fiddled with eclipse for a bit, but couldn't make it debug. I
really like nusphere php-ed. Debugging works great - local or remote to
your web server. Not free, but worth it.
PJ wrote:
Running FreeBSD 7.0, Eclipse SDK 3.3.2, java 1.6.0_03-p4, apache 2.2.8,
php5.2.6, postgresql 8.3.1.
I found that configuring Xdebug just does not work the way all the
manuals, instructions and hints suggest: the only way I could get Xdebug
to work (but does it?), that is, to show up under phpinfo() as both the
zend module and xdebug module was to enter only zend_extension=xdebug.so
in php.ini (with the other configuration parameters) but NOT adding it
to the extensions.ini file.
phpeclipse seems to be working - HOWEVER, it does not ignore php
comments and commented out instructions and the PHP Browser does not
seem to be working.
Such errors as "pg_exec, pg_errormessage() pg_free_result(),
pg_num_rows() & others: supplied argument is not a valid PostgreSQL link
resource" are not caught.
Strangely, the Firefox plugin DBGbar catches these errors... ???
What are Bookmarks in phpEclipse? Are they meant to be breakpoints?
Why does the PHPbrowser (internal) not work?
Why does the preferences page not show PHP Web developing?
Why is only MySQL included and not postgresql in the setup?
Any suggestions, explanations, instructions, sources of information
would be appreciated.
PJ
--
Selwyn Polit
Computer Consulting, programming, web sites
512-696-0410
www.AustinProgressiveCalendar.com
--- End Message ---
--- Begin Message ---
Eric Butera wrote:
On Fri, May 30, 2008 at 11:59 AM, PJ <[EMAIL PROTECTED]> wrote:
Running FreeBSD 7.0, Eclipse SDK 3.3.2, java 1.6.0_03-p4, apache 2.2.8,
php5.2.6, postgresql 8.3.1.
I found that configuring Xdebug just does not work the way all the
manuals, instructions and hints suggest: the only way I could get Xdebug
to work (but does it?), that is, to show up under phpinfo() as both the
zend module and xdebug module was to enter only zend_extension=xdebug.so
in php.ini (with the other configuration parameters) but NOT adding it
to the extensions.ini file.
phpeclipse seems to be working - HOWEVER, it does not ignore php
comments and commented out instructions and the PHP Browser does not
seem to be working.
Such errors as "pg_exec, pg_errormessage() pg_free_result(),
pg_num_rows() & others: supplied argument is not a valid PostgreSQL link
resource" are not caught.
Strangely, the Firefox plugin DBGbar catches these errors... ???
What are Bookmarks in phpEclipse? Are they meant to be breakpoints?
Why does the PHPbrowser (internal) not work?
Why does the preferences page not show PHP Web developing?
Why is only MySQL included and not postgresql in the setup?
Any suggestions, explanations, instructions, sources of information
would be appreciated.
PJ
I used to use phpeclipse. I dumped it for PDT though. I never could
get the debugging to work with phpeclipse. PDT for Eclipse debugging
features work with xdebug & the zend debugger. Give it a look.
Thanks for the suggestion.
I installed the PDT plusgin and still have issues with debugging: Using
the PHP DBG script I get the Gtk-WARNING **: cannot open display:
What do I have to do to install the PHP Browser?
Try as I may, I do not understand what has to be done to correctly
configure xdebug. According to some setup instructions I recall,
phpinfo() should show 2 different sections for the xdebug and zend
xdebug properties. When xdebug seems to be set up, I see a reference at
the botom of the PHP information table that Xdebug v.2.1.0-dev is being
used and there is an xdebug section on the displayed page.
In Eclipse, under the Run/Open Debug Dialog options I see two entries -
PHP DBG Script and X PHP XDebug Script.
So, what is phpeclipse using?
I still see nothing regarding PHP Web Developing in the Preferences
window. :(
How do I view the contents of variables?
And when I run the debugger, I see that it interprets commented out code
and ignores errors for functions like pg_exec() and pg_errormessage()..
I would say that either there are some pretty weird
requirements(unknown) to make php developing and debugging or I am not
understanding something here - like, are there issues with different
versions of the various modules, or what?
This is really frustrating and sadly non-productive.
--- End Message ---