Hi

all

I have a little issue with this php code. Below is the code

CODE: PHP


1.<?
2. include("../includes/common.php");
3. include("../path.php");
4.
5.$func_ary=array("dental_view","add_data","add_data2","mail_data","thanks");
6.if(fe($_REQUEST[act]))
7.{
8. $_REQUEST[act]($_REQUEST[msg]);
9. die();
10.}
11.dental_view();
12.die();
13.
14.
15.################################################
16.function dental_view()
17.{
18. //global $Server_View_Path;
19. $t=new Template("templates");
20. $t->set_file("MyFileHandle","dental_tourism_quote_step1.htm");
21. $t->set_var(array("SERVER_PATH"=>$Server_View_Path,
22. "act"=>"add_data",));
23. $t->parse("MyOutput","MyFileHandle");
24. $t->p("MyOutput");
25.}
26.###################################################
27.function add_data()
28.{
29. //global $Server_View_Path;
30.
31. $t=new Template("templates");
32. $t->set_file("MyFileHandle","dental_tourism_quote_step2.htm");
33. $f=""; $p="";
34. if($_REQUEST)
35. {
36. if($_REQUEST[dp])
37. {
38. $p=implode(",",$_REQUEST[dp]);
39. }
40. $_REQUEST[dp]=$p;
41.
42. if($_REQUEST[db])
43. {
44. $b=implode(",",$_REQUEST[db]);
45. }
46. $_REQUEST[db]=$b;
47. }
48.
49. foreach($_REQUEST as $k=>$v)
50. {if($k!="act")
51. $hidden.="<input type=\"hidden\" name=\"$k\" value=\"$v\" >";
52. }
53.
54. $t->set_var(array("hidden"=>$hidden,"SERVER_PATH"=>$Server_View_Path,
55. "act"=>"add_data2",));
56. $t->parse("MyOutput","MyFileHandle");
57. $t->p("MyOutput");
58.}
59.###########################################
60.function add_data2()
61.{
62. //global $Server_View_Path;
63. $t=new Template("templates");
64. $t->set_file("MyFileHandle","dental_tourism_quote_step3.htm");
65. if($_REQUEST)
66. {
67. if($_REQUEST[suffer])
68. {
69. $_REQUEST[suffer]=implode(",",$_REQUEST[suffer]);
70. }
71.
72. if($_REQUEST[undergone])
73. {
74. $_REQUEST[undergone]=implode(",",$_REQUEST[undergone]);
75. }
76. }
77.
78. foreach($_REQUEST as $k=>$v)
79. {
80. if($k!="act")
81. $hidden.="<input type=\"hidden\" name=\"$k\" value=\"$v\" >";
82. }
83. $t->set_var(array("hidden"=>$hidden,"SERVER_PATH"=>$Server_View_Path,
84. "act"=>"mail_data",));
85. $t->parse("MyOutput","MyFileHandle");
86. $t->p("MyOutput");
87.}
88.
89.
90.###############################################
91.function mail_data()
92.{
93.
94. //global $Server_View_Path;
95. $t=new Template("templates");
96. $t->set_file("MyFileHandle","mail.htm");
97.
98. if($_REQUEST)
99. {
100. foreach($_REQUEST as $k => $v)
101. {
102. $t->set_var(array( "$k" => $v,));
103. }
104. }
105. $t->parse("MyOutput","MyFileHandle");
106. $message=$t->get("MyOutput","MyFileHandle");
107. // send_mail("r",$_REQUEST[email_address],"rashmim","rashmi@cynets.com","Online appointment form submitted.",$message);
108. send_mail_new("CompleteDentalCare","info@completedentalcare.co.in","completedentalcare.co.in","Info@completedentalcare.co.in","Online appointment form submitted.",$message);
109. //send_mail_new("CompleteDentalCare",$_REQUEST[email_address],"completedentalcare.co.in","Info@completedentalcare.co.in","Online appointment form submitted.",$message);
110.
111. if(!get_row_con_info("dc_email","Where `dc_email`='$_REQUEST[email_address]'", "dc_email", $email))
112. {
113. $SQL="INSERT INTO `dc_email` (`dc_email_id` , `dc_email` ) VALUES ('', '$_REQUEST[email_address]')";
114. ei($SQL);
115. }
116. thanks();
117.}
118.#########################################
119.function thanks()
120.{
121. //global $Server_View_Path;
122. $t=new Template("templates");
123. $t->set_file("MyFileHandle","thanks.htm");
124. $t->set_var(array("SERVER_PATH"=>$Server_View_Path));
125. $t->parse("MyOutput","MyFileHandle");
126. $t->p("MyOutput");
127.}
128.?>

While executing this code . I get error.

The error is :
Fatal error: Call to undefined function fe() on line 6

plz anyone can help me as i'm not able to figure out this issue.

Recommended Answers

All 4 Replies

Do you have a function called fe ? If yes, is it in a different file ? If no, what does

if(fe($_REQUEST[act]))

mean ?

it means that it cannot locate the fe() in your script.try to include the file where the function resides.

Nicky: in the future, wrap your code in [code=php] and [/code] tags to have it automatically add line numbers and syntax highlight your code.

What does the fe() function do? Have you defined it in another file that you do an include on?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.