ZendStudio - отладка скрипта с параметром

first_may

Новичок
ZendStudio - отладка скрипта с параметром

Добрый день!

Подскажите пожалуйста, как в ZendStudio делать отладку скрипта с параметром?
 

Фанат

oncle terrible
Команда форума
а чем отличается скрипт с параметром от скрипта без параметра?
 

Alexandre

PHPПенсионер
first_mayдумаю, ты не учел иные варианты

с параметром вполне может быть
Код:
> php myscript.php param1 param2 param3
 

first_may

Новичок
вполне, прсто я только начал изучать....
вот как в таких случаях делать отладку?
 

Wicked

Новичок
first_may
Заходите на страницу test.php?a=1&b=1 в браузере и нажимаете Debug this page в Zend toolbar'е. По-моему так.
 

first_may

Новичок
ТО Wicked

поподробней можно, а то не получается по нажатию кнопки попатьс в отладчик... Пробую вот на этом скрипте:

<html>
<head>
<title>Форма с обязательным заполнением полей</title>
</head>
<?php
function show_form($l_name, $email) {
?>
<form action="form.php" method="post">
Ваше имя *<input type="text" name="l_name" value="<?php print $l_name ?>"><br>
E-mail*<input type="text" name="email" value="<?php print $email ?>"><br>
<input type="submit" name="submit" value="Отправить!"><input type="Reset">
</form>
<?
}
function check_form($l_name, $email) {
if(!$l_name || !$email):
print("Вы не заполнили нужные поля!<br>");
if(!$l_name) {
print("Введите Ваше имя.<br>");
}
if(!$email) {
print("Введите ваш e-mail.<br>");
}
show_form($l_name, $email);
else:
confirm_form($l_name, $email);
endif;
}
function confirm_form($l_name, $email) {
?>
<h2>Введенная Вами информация:</h2>
<?
print("<br>$l_name<br>$email\n");
}
if(!$submit):
?>
<p>Введите информацию о себе</p>
<p>Все поля обязательны для заполнения.<p>
<?php
show_form("", "");
else:
check_form($l_name, $email);
endif;
?>
</body>
</html>
 

Фанат

oncle terrible
Команда форума
first_may
Попробуй раз в жизни обойтись без отладчика.
Значения переменных, если ты не в курсе, можно выводить ручками.
И пошаговую трассировку тоже сделать несложно.
 

first_may

Новичок
без отладчика не могу :), вот наверное самый простой вариант

есть форма calc.htm:

<html>
<head>
<title>Калькулятор</title>
</head>

<body>

<form method="post" action="calc.php">
n1=<input type="Text" name="n1"><br>
n2=<input type="Text" name="n2"><br>

<input type="Radio" name="calc" value="add">+<br>
<input type="Radio" name="calc" value="sub">-<br>
<input type="Radio" name="calc" value="mul">*<br>
<input type="Radio" name="calc" value="div">/<br>
<input type="Submit" value="Результат">
</form>

</body>
</html>



файл calc.php:

<?
if ($calc=="add"){
$res=$n1+$n2;
}
if ($calc=="sub"){
$res=$n1-$n2;
}
if ($calc=="mul"){
$res=$n1*$n2;
}
if ($calc=="div"){
$res=$n1/$n2;
}
?>

<html>
<head>
<title>Калькулятор</title>
</head>
<body>

<p>Ответ: <? echo "$res"; ?></p>

</body>
</html>



Как по нажатию кнопки в calc.htm попасть в calc.php, что бы пройтись по шагам?
 

Vallar_ultra

Любитель выпить :)
2first_may
Zend Studio не является веб-сервером и соответственно ты без внешнего сервака и натравленного на него зендового дебагера не сможешь пройтись по шагам ....
 

Vallar_ultra

Любитель выпить :)
ну дык и натрави на него ZendDebugger :)
Просто отладка будет идти сразу на твоём апаче...
 

first_may

Новичок
ну дык и спрашиваю как это сделать? у меня уставновлена только Zend Studio, этого достаточно?
 

Vallar_ultra

Любитель выпить :)
добавляешь адрес своего web-server (http://127.0.0.1), указываешь что это сервак, ставишь флаг Debug All Pages и вроде всё.... на память больше не помню что надо делать..
 

first_may

Новичок
я проставил следующее

Open Browser At - http://localhost/
поставил флаг - Debug All Pages
поставил флаг - The Server

нажал Ok, открылась форма Browser, появилась форма
Opening Debug Connect с двумя закладками и на закладке Errors сообщение:

The Zend Debug Server did not connect.
Please check the Troubleshooting pane for possible causes.

-~{}~ 20.12.06 12:02:

Troubleshooting pane:


If the debug session fails to start,
please check the following list of common problems:

- The address you're trying to connect to may be invalid.
- The Zend Debug Server may not be properly
installed on the server you're connecting to.
You can test this by checking the output of phpinfo()
on your server, and search for 'Zend Debugger'.
If it's not installed, you should install the
Zend Platform on your server.
- The Zend Platform may be configured not to
allow your host to start debug sessions.
You can configure the list of allowed/denied hosts in
the Zend Platform, or in your php.ini file.
- Your machine may be firewalled, and prevent the
Zend Debug Server from connecting to it.
The Zend Debug Server attempts to connect back to your
machine at a specified port (default is 10000, can be
configured in the Preferences Dialog ->Debug Tab).
You may have to open this port in your firewall
to enable remote debugging.
- The address you typed in may not be a valid PHP file.
PHP must be installed on the server, and configured
to handle the specified extension as a PHP file.
- You may be trying to connect through a proxy server.
Try to disable your proxy (entirely, or for the specific
server that you're trying to connect to).
- Possibly, some other type of error may have occurred.
Try to check the end of your server's error log
(typically under /var/log/httpd/error_log in UNIX
systems) for possible error messages.
- The Zend Platform URL defined in the Preferences
is different than the Tunneling Target Host URL defined
in the Tunneling Settings dialog.
 

Vallar_ultra

Любитель выпить :)
Zend Studio Server там стоит (на http://localhost/)? надо ставить, иначе никак :(
 
Сверху