找回密码
 立即注册
搜索
查看: 167|回复: 2

已经解决::请问 有使用Delphi For PHP的么?

[复制链接]

498

主题

5866

回帖

8541

积分

网站编辑

LMSung

积分
8541
发表于 2007-5-11 14:09:01 | 显示全部楼层 |阅读模式
自己写的php代码和DFP网站下载的代码在运行的时候都会显示网页有错误,页面可以显示出.
查看网页代码的时候看到这个
<script type="text/javascript" src="file:///c:/program files/codegear/delphi for php/1.0 / Vcl/js/common.js"></script>
还会弹出错误提示框说这个文件的路径错误,请问一下为何是绝对路径而不是相对路径呢?谢谢




只能保存在我的文档中,并且我的文档不能指定C盘以外的位置.....

[ 本帖最后由 ricoman 于 2007-5-11 21:17 编辑 ]
男人 没良心.

42

主题

835

回帖

1167

积分

金牌会员

积分
1167
发表于 2007-5-11 14:35:18 | 显示全部楼层
不太明白你的意思
网页不就是文本么?里面的内容全是你输入的。内容是什么完全由你控制
当然,假如由一些网页制作软降编辑过后比如dreamweaver之类的,会把相对路径改成绝对路径
回复

使用道具 举报

498

主题

5866

回帖

8541

积分

网站编辑

LMSung

积分
8541
 楼主| 发表于 2007-5-11 15:10:05 | 显示全部楼层
比如 这个PHP文件
  1. <?php
  2.         //Includes
  3.         require_once("vcl/vcl.inc.php");
  4.         use_unit("dbgrids.inc.php");
  5.         use_unit("db.inc.php");
  6.         use_unit("dbtables.inc.php");
  7.         use_unit("forms.inc.php");
  8.         use_unit("extctrls.inc.php");
  9.         use_unit("stdctrls.inc.php");

  10.         //Class definition
  11.         class Index extends Page
  12.         {
  13.                public $Label1 = null;
  14.                public $Button1 = null;
  15.                function Button1JSClick($sender, $params)
  16.                {
  17.                     //Dump the call using Ajax to the Button1Click event
  18.                     echo $this->Button1->ajaxCall("Button1Click");
  19.                ?>
  20.                     //Return false to prevent the button submit the form
  21.                     return(false);
  22.                <?php
  23.                }

  24.                function Button1Click($sender, $params)
  25.                {
  26.                     $this->Button1->Caption="clicked Ajax ".date("Y-m-d H:i:s");
  27.                     $this->Label1->Caption="Hello from Ajax!! ".date("Y-m-d H:i:s");
  28.                     $this->Label1->Color="#".dechex(rand(0,0xFFFFFF));
  29.                }

  30.         }

  31.         global $application;

  32.         global $Index;

  33.         //Creates the form
  34.         $Index=new Index($application);

  35.         //Read from resource file
  36.         $Index->loadResource(__FILE__);

  37.         //Shows the form
  38.         $Index->show();

  39. ?>
复制代码




正常的运行结果是这样的
  1. <!-- Index begin -->

  2. <html >
  3. <head>
  4. <script type="text/javascript" src="/vcl-bin/js/common.js"></script>
  5.         <script type="text/javascript">
  6. var xajaxRequestUri="http://www.qadram.com/vcl4php/samples/Ajax/Basic/basicajax.php";
  7. var xajaxDebug=false;
  8. var xajaxStatusMessages=false;
  9. var xajaxWaitCursor=true;
  10. var xajaxDefinedGet=0;
  11. var xajaxDefinedPost=1;
  12. var xajaxLoaded=false;
  13. function xajax_ajaxProcess(){return xajax.call("ajaxProcess", arguments, 1);}
  14.         </script>
  15.         <script type="text/javascript" src="/vcl-bin/xajax/xajax_js/xajax.js"></script>
  16.         <script type="text/javascript">
  17. window.setTimeout(function () { if (!xajaxLoaded) { alert('Error: the xajax Javascript file could not be included. Perhaps the URL is incorrect?\nURL: /vcl-bin/xajax/xajax_js/xajax.js'); } }, 6000);
  18.         </script>
  19. <title>Basic Ajax Example</title>
  20. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  21. <script type="text/javascript">
  22. <!--
  23. function Button1JSClick(event)
  24. {

  25. var event = event || window.event;
  26. var params=null;
  27. xajax_ajaxProcess('Index','Button1',params,'Button1Click',xajax.getFormValues('Index'));
  28.                      //Return false to prevent the button submit the form
  29.                     return(false);
  30.                
  31. }

  32. function Button1ClickWrapper(event, hiddenfield, submitvalue, wrappedfunc)
  33. {

  34. var event = event || window.event;
  35. submit1=true;
  36. submit2=true;
  37. if (typeof(wrappedfunc) == 'function') submit1=wrappedfunc(event);
  38. hiddenfield.value = submitvalue;
  39. if ((hiddenfield.form.onsubmit) && (typeof(hiddenfield.form.onsubmit) == 'function')) submit2=hiddenfield.form.onsubmit();
  40. if ((submit1) && (submit2)) hiddenfield.form.submit();
  41. return false;

  42. }

  43. -->
  44. </script>
  45. </head>

  46. <body  style=" margin-left: 0px;  margin-top: 0px;  margin-right: 0px;  margin-bottom: 0px; "  >
  47. <form style="margin-bottom: 0" id="Index" name="Index" method="post"  action="/vcl4php/samples/Ajax/Basic/basicajax.php">
  48. <table  width="800"   style="height:600px"  border="0" cellpadding="0" cellspacing="0"  ><tr><td valign="top">
  49. <div id="Button1_outer" style="Z-INDEX: 0; LEFT: 16px; WIDTH: 240px; POSITION: absolute; TOP: 14px; HEIGHT: 58px">
  50. <input type="submit" id="Button1" name="Button1" value="Button1"  onclick="return Button1ClickWrapper(event, document.forms[0].Button1SubmitEvent, 'Button1_Button1Click', Button1JSClick)"  style=" font-family: Verdana; font-size: 10px;  height:58px;width:240px;"   tabindex="0"    /><input type="hidden" id="Button1SubmitEvent" name="Button1SubmitEvent" value="" />
  51. </div>
  52. <div id="Label1_outer" style="Z-INDEX: 1; LEFT: 272px; WIDTH: 328px; POSITION: absolute; TOP: 16px; HEIGHT: 56px">
  53. <div id="Label1" style=" font-family: Verdana; font-size: 10px;  height:56px;width:328px;"   >Label1</div>
  54. </div>
  55. </td></tr></table>
  56. </form></body>
  57. </html>
  58. <!-- Index end -->
复制代码





我这个却这样了

  1. <!-- Index begin -->

  2. <html >
  3. <head>
  4. <script type="text/javascript" src="file:///c:/program files/codegear/delphi for php/1.0/vcl/js/common.js"></script>
  5.         <script type="text/javascript">
  6. var xajaxRequestUri="http://localhost:3569/basicajax.php?restore_session=1&DBGSESSID=1";
  7. var xajaxDebug=false;
  8. var xajaxStatusMessages=false;
  9. var xajaxWaitCursor=true;
  10. var xajaxDefinedGet=0;
  11. var xajaxDefinedPost=1;
  12. var xajaxLoaded=false;
  13. function xajax_ajaxProcess(){return xajax.call("ajaxProcess", arguments, 1);}
  14.         </script>
  15.         <script type="text/javascript" src="file:///c:/program files/codegear/delphi for php/1.0/vcl/xajax/xajax_js/xajax.js"></script>
  16.         <script type="text/javascript">
  17. window.setTimeout(function () { if (!xajaxLoaded) { alert('Error: the xajax Javascript file could not be included. Perhaps the URL is incorrect?\nURL: file:///c:/program files/codegear/delphi for php/1.0/vcl/xajax/xajax_js/xajax.js'); } }, 6000);
  18.         </script>
  19. <title>Basic Ajax Example</title>
  20. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  21. <script type="text/javascript">
  22. <!--
  23. function Button1JSClick(event)
  24. {

  25. var event = event || window.event;
  26. var params=null;
  27. xajax_ajaxProcess('Index','Button1',params,'Button1Click',xajax.getFormValues('Index'));
  28.                      //Return false to prevent the button submit the form
  29.                     return(false);
  30.                
  31. }

  32. function Button1ClickWrapper(event, hiddenfield, submitvalue, wrappedfunc)
  33. {

  34. var event = event || window.event;
  35. submit1=true;
  36. submit2=true;
  37. if (typeof(wrappedfunc) == 'function') submit1=wrappedfunc(event);
  38. hiddenfield.value = submitvalue;
  39. if ((hiddenfield.form.onsubmit) && (typeof(hiddenfield.form.onsubmit) == 'function')) submit2=hiddenfield.form.onsubmit();
  40. if ((submit1) && (submit2)) hiddenfield.form.submit();
  41. return false;

  42. }

  43. -->
  44. </script>
  45. </head>

  46. <body  style=" margin-left: 0px;  margin-top: 0px;  margin-right: 0px;  margin-bottom: 0px; "  >
  47. <form style="margin-bottom: 0" id="Index" name="Index" method="post"  action="/basicajax.php">
  48. <table  width="800"   style="height:600px"  border="0" cellpadding="0" cellspacing="0"  ><tr><td valign="top">
  49. <div id="Button1_outer" style="Z-INDEX: 0; LEFT: 16px; WIDTH: 240px; POSITION: absolute; TOP: 14px; HEIGHT: 58px">
  50. <input type="submit" id="Button1" name="Button1" value="Button1"  onclick="return Button1ClickWrapper(event, document.forms[0].Button1SubmitEvent, 'Button1_Button1Click', Button1JSClick)"  style=" font-family: Verdana; font-size: 10px;  height:58px;width:240px;"   tabindex="0"    /><input type="hidden" id="Button1SubmitEvent" name="Button1SubmitEvent" value="" />
  51. </div>
  52. <div id="Label1_outer" style="Z-INDEX: 1; LEFT: 272px; WIDTH: 328px; POSITION: absolute; TOP: 16px; HEIGHT: 56px">
  53. <div id="Label1" style=" font-family: Verdana; font-size: 10px;  height:56px;width:328px;"   >Label1</div>
  54. </div>
  55. </td></tr></table>
  56. </form></body>
  57. </html>
  58. <!-- Index end -->
复制代码






正确的是 <script type="text/javascript" src="/vcl-bin/js/common.js"></script>
我运行后是这样的<script type="text/javascript" src="file:///c:/program files/codegear/delphi for php/1.0/vcl/js/common.js"></script>
男人 没良心.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|海浩社区

GMT+8, 2025-9-22 06:25 , Processed in 0.084847 second(s), 22 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表