473,327 Members | 2,118 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Better way ?

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
3 1642
"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
"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
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
3
by: Muhd | last post by:
<usualDisclaimer>Please forgive me if this is in the wrong group, and if so, what is the right group.</usualDisclaimer> Let me start off by first saying im a newb. Ok, with that out of the way I...
24
by: Faith Dorell | last post by:
I really don´t like C.You can write better programs in BASIC than in C, if you don´t like this language. I don´t understand how C became so popular, although much better programming languages...
43
by: Rob R. Ainscough | last post by:
I realize I'm learning web development and there is a STEEP learning curve, but so far I've had to learn: HTML XML JavaScript ASP.NET using VB.NET ..NET Framework ADO.NET SSL
33
by: Protoman | last post by:
Which is better for general-purpose programming, C or C++? My friend says C++, but I'm not sure. Please enlighten me. Thanks!!!!!
22
by: JoeC | last post by:
I am working on another game project and it is comming along. It is an improvment over a previous version I wrote. I am trying to write better programs and often wonder how to get better at...
19
by: Alexandre Badez | last post by:
I'm just wondering, if I could write a in a "better" way this code lMandatory = lOptional = for arg in cls.dArguments: if arg is True: lMandatory.append(arg) else: lOptional.append(arg)...
23
by: mike3 | last post by:
Hi. (posted to both newsgroups since I was not sure of which would be appropriate for this question or how specific to the given language it is. If one of them is inappropriate, just don't send...
20
by: mike3 | last post by:
Hi. (Xposted to both comp.lang.c++ and comp.programming since I've got questions related to both C++ language and general programming) I've got the following C++ code. The first routine runs in...
3
by: Ryan Liu | last post by:
Hi, Is Async I/O (e.g. NetworkStream.Begin/End Read/Write) always better than synchronous I/O? At least as good? When I don't concern about easy or difficult to write code, should I always...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.