By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,053 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,053 IT Pros & Developers. It's quick & easy.

Better way ?

P: n/a
All,
I work on my site on my local machine, which when saved, it is synced to the
live web server. I don't have a "temp" site in between. All my edits are
basically live. Sometimes I want to echo stuff to the screen so I can see
what's there, etc. but I don't want anyone else during my testing to see it.
This is what I came up with:

function debug($debugvar) {
$ip = $_SERVER["REMOTE_ADDR"];
if($ip == "10.1.1.1")
{
echo $debugvar;
}
}

then whereever I need to see something, I call this:
instead of echo $secvalue; I would use debug($secvalue);

without setting up a testing site, is this the best way to approach this ?
Thanks.
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"StinkFinger" <st****@pinky.com> wrote in message
news:10*************@corp.supernews.com...
All,
I work on my site on my local machine, which when saved, it is synced to the live web server. I don't have a "temp" site in between. All my edits are
basically live. Sometimes I want to echo stuff to the screen so I can see
what's there, etc. but I don't want anyone else during my testing to see it. This is what I came up with:

function debug($debugvar) {
$ip = $_SERVER["REMOTE_ADDR"];
if($ip == "10.1.1.1")
{
echo $debugvar;
}
}

then whereever I need to see something, I call this:
instead of echo $secvalue; I would use debug($secvalue);

without setting up a testing site, is this the best way to approach this ?
Thanks.


Don't do the automatic sync.
Jul 17 '05 #2

P: n/a
"StinkFinger" <st****@pinky.com> wrote in message
news:<10*************@corp.supernews.com>...

I work on my site on my local machine, which when saved, it is synced
to the live web server. I don't have a "temp" site in between.
So why can't you test on your local machine?
All my edits are basically live.
Which is basically a bad idea.
Sometimes I want to echo stuff to the screen so I can see what's there,
etc. but I don't want anyone else during my testing to see it.

without setting up a testing site, is this the best way to approach this ?


Enable debugging on the remote server and use a professional IDE
(Zend Studio or NuSphere PHPEdit). This way, you can debug without
ever outputting anything on screen.

Cheers,
NC
Jul 17 '05 #3

P: n/a
> Enable debugging on the remote server and use a professional IDE
(Zend Studio or NuSphere PHPEdit). This way, you can debug without
ever outputting anything on screen.


First of all NuSphere's product is known as PHPED, not PHPEDIT :)
All the rest is truth. With a professional debugger like DBG you can
debug even your live site without any risk. In this order, you can run
debug sessions through SSH tunnel and therefore avoid any chance to be
"compromised". At least unless SSHD is compromised too...
DBG and PHPED HOWTOs are available there:
http://ww1.nusphere.com/support/viewforum.php?f=11

-JV.
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.