NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
how to start debugging


Joined: 09 Sep 2006
Posts: 5
Reply with quote
I try to run this simple codes:

Forma1:

Code:
<HTML>
<HEAD>
<STYLE TYPE=”text/css”>
<!--
BODY, P {color: black; font-family: verdana;
font-size: 10 pt}
H1 {color: black; font-family: arial; font-size: 12 pt}
-->
</STYLE>
</HEAD>
<BODY>
<TABLE BORDER=0 CELLPADDING=10 WIDTH=80% align=CENTER>
<TR>
<TD BGCOLOR="#F0F8FF" ALIGN=CENTER VALIGN=TOP></TD>
<TD BGCOLOR="#FFFFFF" ALIGN=LEFT VALIGN=TOP>
<H1>Newsletter sign-up form</H1>
<FORM METHOD="POST" ACTION="Forma2.php">
<P>Su Nombre:</P>
<INPUT TYPE="text" SIZE=25 NAME="nombre">
<BR>
<P>Su Email:</P>
<INPUT TYPE="text" SIZE=25 NAME="email">
<BR>
<P>Su Teléfono:</P>
<INPUT TYPE="text" SIZE=25 NAME="telefono">
<BR>
<BR>
<INPUT TYPE="submit" NAME=”submit” VALUE="Submit">
</FORM>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>


Forma2:

Code:
<HTML>
<HEAD>
<STYLE TYPE=”text/css”>
<!--
BODY, P {color: black; font-family: verdana;
font-size: 10 pt}
H1 {color: black; font-family: arial; font-size: 12 pt}
-->
</STYLE>
</HEAD>
<BODY>
<TABLE BORDER=0 CELLPADDING=10 WIDTH=100%>
<TR>
<TD BGCOLOR="#F0F8FF" ALIGN=CENTER VALIGN=TOP WIDTH=17%>
</TD>
<TD BGCOLOR="#FFFFFF" ALIGN=LEFT VALIGN=TOP WIDTH=83%>
<H1>Newsletter sign-up form</H1>
<?php
if (!$_POST['email'] || $_POST['email'] == "" ||
strlen($_POST['email']) > 30) {
echo '<P>There is a problem. Did you enter an email address?</P>';
} else {
// Open connection to the database
mysql_connect("localhost", "root", "doremi")
or die("Failure to communicate with database");
mysql_select_db("test");
// Insert email address
$as_email = addslashes($_POST['email']);
$tr_email = trim($as_email);
$tr_nombre = $_POST(['nombre']);
$tr_telefono = $_POST(['telefono'];
$query = "INSERT INTO pruebas (NOMBRE, EMAIL,TELEFONO) VALUES('$tr_nombre', '$tr_email', '$tr_telefono)";
$result = mysql_query($query);
if (mysql_affected_rows() == 1) {
echo '<P>Your information has been recorded.</P>';
} else {
error_log(mysql_error());
echo '<P>Something went wrong with your signup attempt.</P>';
}
}
?>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>


Buit I receive this error

SRV Server:
Document Contains no data.


Please, what is wrong?

Thanks for your help
View user's profileFind all posts by jeva39Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Your "Forma1" has no php code and therefore there is nothing to debug. Just open (run) it in external browser, click Debug Next Page (Next Porst) in the NuSphere ToolBar, then clic Submit button on your form.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 09 Sep 2006
Posts: 5
Reply with quote
Please explain me a little: I only see two modes of run: F9 and CTRL-F9. If I run with CTRL-F9 don't appear any button in the toolbar that say Debug Next Page and if I run with F9 send this error:

Failed to start Debug Session (Error:1) Please verify settings for the local debugger module.

Other thing: what is "Run in External Browser?.

Sorry by this questions but I'm new to NuSphere.

Thanks for your help!!!
View user's profileFind all posts by jeva39Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
well,
"run with debugger" is what available with default shorcut F9. It works for PHP files and only for php files. Under PHP files we understand files with PHP CODE in.
Your Forma1 for example HAS NO php code in and therefore there is nothing to debug. It's a pure HTML file.

"run" is what available there with default shorcut Ctrl-F9. It may show your either HTML files (or files with no PHP CODE in) or PHP files. Therefore you can "run" your Forma1.

Regarding "external browsers", it depends on PHPED version. Starting with 4.6, PHPED detects installed browsers and let you select one as "external". See "default browser" button on the toolbar next to "accounts" button.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 09 Sep 2006
Posts: 5
Reply with quote
Thanks!! Now I understand this topic of the editor.

OK. The problem is: if I run with external Browser (Explorer 7.0), disappear the IDE of PHPEd and I can't see any button for debug the Forma2. And, as I say in other post, if I run with CTRL-F9, don't appear enabled any button for Debug. Please what I can make wrong? (My version is 4.6). I try to debug the Forma2 (including manual the data for the Email, Nombre and Telefono variables), but appear the same debug error I refered in the above post. Thanks again...
View user's profileFind all posts by jeva39Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
http://forum.nusphere.com/howto-run-debug-session-t585.html
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 09 Sep 2006
Posts: 5
Reply with quote
Thanks!
View user's profileFind all posts by jeva39Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
BTW, IE 7.0 beta brings much more problem than solves, so I'd recommend not to use it.

Feel free to let know if you face up with a particular problem in debugger.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 09 Sep 2006
Posts: 5
Reply with quote
Unfortunately the error using FireFox is the same. In other hand, I follow the instructions contained in your above link but the editor does not send any specific error. Simply again
SRV Server: Document Contains no data. I think that I have any bad configuration fo mySql or PHP or simply errors in my code. At the moment I am reviewing this topic.
View user's profileFind all posts by jeva39Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
SRV Server: Document Contains no data - means that your script did not return any data, in other words - the document appeared empty.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
how to start debugging
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic