Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 12-11-2002, 08:59 PM   #1 (permalink)
Henry
Registered User
 
Join Date: Dec 2002
Location: Chicago
Posts: 13
Henry is on a distinguished road
cgi script

I am trying to use a script called emform to process a survey. The emform file that I placed in the action filed of the Inspector pallette of Adobe GoLive 6 looks like:
I downloaded the script from
http://www.eternalmart.com
When I submit answers in the survey
http://thirdunitarianchurch.org/Comm...%20Survey.html
I get a bunch of warning messages.

ANy ideas of where I go from here?
<?
include("emform_config.php");
include("$emform_path/emform_msg.php");
include("$emform_path/emform_notify.php");
include("$emform_path/emform_func.php");
include("$emform_path/emform_class.php");
include("$emform_library_path/class_template.php");
include("$emform_library_path/class_template_db.php");
include("$emform_library_path/sql_func.php");
include("$emform_library_path/class_list.php");
include("$emform_library_path/class_form_field.php");
include("$emform_library_path/class_email_info.php");
include("$emform_library_path/class_form_info.php");
include("$emform_library_path/class_em_file.php");

$config_array = array(
"emform_path" => $emform_path,
"emform_admin_path" => $emform_admin_path,
"emform_upload_path" => $emform_upload_path,
"emform_url" => $emform_url,
"emform_admin_url" => $emform_admin_url,
"emform_image_url" => $emform_image_url,
"emform_library_path" => $emform_library_path,
"emform_script_url" => "$emform_url/emform.php",
"admin_url" => "$emform_admin_url/admin.php",
"eternalmart" => $eternalmart,
"os" => $os
);

$emsql = new sql_class($DbHost,$DbUser,$DbPassword,$DbDatabase) ;

$input_para = array(
"form" => array("PG","S")
);

get_input_para($input_para);

$form_obj = new class_form_info($form,$emsql);

// assign form field variable
$form_fields = $form_obj->get_field_info();

$form_arr[] = "action";
$form_upload_files_arr = array();
if(is_array($form_fields)){
reset($form_fields);
for($i=0;$i<count($form_fields);$i++){
if($form_fields[$i]["em_type"] == "file"){
// file upload
$form_upload_files_arr[] = get_prefix().$form_fields[$i]["em_name"];
}
else{
$form_arr[] = get_prefix().$form_fields[$i]["em_name"];
}
}
}

$input_para = array(
"emform" => array("PG",$form_arr,$form_upload_files_arr)
);

get_input_para($input_para);

$template_obj = new class_template_db("emform_template",$emsql);

$emform_obj = new emform_class($config_array,$emsql,$form,$emform);
$emform_obj->set_form_info($form_obj->get_form_info());
$emform_obj->set_table_info($form_obj->get_table_info());
$emform_obj->set_tpl($template_obj);
$emform_obj->set_field_info($form_obj->get_field_info());
$emform_obj->set_reply_email($form_obj->get_reply_email());
$emform_obj->set_notify_email($emform_notify);
$emform_obj->set_emform_validation($form_obj->validation_rule);
$emform_obj->run();

?>
Henry is offline   Reply With Quote
Old 12-11-2002, 09:39 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
can you copy some errors? i tried that page, but it would not let me submit.
sde is offline   Reply With Quote
Old 12-12-2002, 06:20 AM   #3 (permalink)
DesertWolf
Non-profit Techie
 
DesertWolf's Avatar
 
Join Date: Dec 2002
Location: Mesa AZ
Posts: 76
DesertWolf is on a distinguished road
Send a message via AIM to DesertWolf
I know it might seem stupid but, my first question would be if you have php on the server you are using.
DesertWolf is offline   Reply With Quote
Old 12-12-2002, 06:43 AM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
if he's getting warning messages, my guess would be yes. otherwise, it would not process the script , and just print the php as it is on the page.
sde is offline   Reply With Quote
Old 12-12-2002, 07:04 AM   #5 (permalink)
DesertWolf
Non-profit Techie
 
DesertWolf's Avatar
 
Join Date: Dec 2002
Location: Mesa AZ
Posts: 76
DesertWolf is on a distinguished road
Send a message via AIM to DesertWolf
I went and filled out the form and here are the errors I got when it was submitted:


Warning: Unable to access /web.vilitas.com/thirdunitarianchurch.org/html/emform/emform_msg.php in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 3

Warning: Failed opening '/web.vilitas.com/thirdunitarianchurch.org/html/emform/emform_msg.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 3

Warning: Unable to access /web.vilitas.com/thirdunitarianchurch.org/html/emform/emform_notify.php in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 4

Warning: Failed opening '/web.vilitas.com/thirdunitarianchurch.org/html/emform/emform_notify.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 4

Warning: Unable to access /web.vilitas.com/thirdunitarianchurch.org/html/emform/emform_func.php in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 5

Warning: Failed opening '/web.vilitas.com/thirdunitarianchurch.org/html/emform/emform_func.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 5

Warning: Unable to access /web.vilitas.com/thirdunitarianchurch.org/html/emform/emform_class.php in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 6

Warning: Failed opening '/web.vilitas.com/thirdunitarianchurch.org/html/emform/emform_class.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 6

Warning: Unable to access /web.vilitas.com/thirdunitarianchurch.org/html/emform/library/class_template.php in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 7

Warning: Failed opening '/web.vilitas.com/thirdunitarianchurch.org/html/emform/library/class_template.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 7

Warning: Unable to access /web.vilitas.com/thirdunitarianchurch.org/html/emform/library/class_template_db.php in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 8

Warning: Failed opening '/web.vilitas.com/thirdunitarianchurch.org/html/emform/library/class_template_db.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 8

Warning: Unable to access /web.vilitas.com/thirdunitarianchurch.org/html/emform/library/sql_func.php in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 9

Warning: Failed opening '/web.vilitas.com/thirdunitarianchurch.org/html/emform/library/sql_func.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 9

Warning: Unable to access /web.vilitas.com/thirdunitarianchurch.org/html/emform/library/class_list.php in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 10

Warning: Failed opening '/web.vilitas.com/thirdunitarianchurch.org/html/emform/library/class_list.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 10

Warning: Unable to access /web.vilitas.com/thirdunitarianchurch.org/html/emform/library/class_form_field.php in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 11

Warning: Failed opening '/web.vilitas.com/thirdunitarianchurch.org/html/emform/library/class_form_field.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 11

Warning: Unable to access /web.vilitas.com/thirdunitarianchurch.org/html/emform/library/class_email_info.php in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 12

Warning: Failed opening '/web.vilitas.com/thirdunitarianchurch.org/html/emform/library/class_email_info.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 12

Warning: Unable to access /web.vilitas.com/thirdunitarianchurch.org/html/emform/library/class_form_info.php in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 13

Warning: Failed opening '/web.vilitas.com/thirdunitarianchurch.org/html/emform/library/class_form_info.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 13

Warning: Unable to access /web.vilitas.com/thirdunitarianchurch.org/html/emform/library/class_em_file.php in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 14

Warning: Failed opening '/web.vilitas.com/thirdunitarianchurch.org/html/emform/library/class_em_file.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 14

Fatal error: Cannot instantiate non-existent class: sql_class in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 30
DesertWolf is offline   Reply With Quote
Old 12-12-2002, 07:29 AM   #6 (permalink)
Henry
Registered User
 
Join Date: Dec 2002
Location: Chicago
Posts: 13
Henry is on a distinguished road
cgi script

I ftp'd the entire emform folder onto the server. The folder includes several folders: admin, docs, images, library, sql, and template - plus six seperate files listed as: emform, emform_config, _class, _func, _msg, _notify. I was only able to open and edit the seperate emform_ files in GoLive, I was not able to open any of the files in the other folders. I entered information like dbname, username, password, admin url, etc into the emform_config and emform files. I just wrote what seemed appropriate into the "" (quotation marks). Here's some of the script:
$config_array = array(
"emform_path" => $emform_path,
"emform_admin_path" => $emform_admin_path,
"emform_upload_path" => $emform_upload_path,
"emform_url" => $emform_url,
"emform_admin_url" => $emform_admin_url,
"emform_image_url" => $emform_image_url,
"emform_library_path" => $emform_library_path,
"emform_script_url" => "$emform_url/emform.php",
"admin_url" => "$emform_admin_url/admin.php",
"eternalmart" => $eternalmart,
"os" => $os

I was not sure if I was supposed to repeat this information down at the bottom of the script on the emform file
$emform_obj = new emform_class($config_array,$emsql,$form,$emform);
$emform_obj->set_form_info($form_obj->get_form_info());
$emform_obj->set_table_info($form_obj->get_table_info());
$emform_obj->set_tpl($template_obj);
$emform_obj->set_field_info($form_obj->get_field_info());
$emform_obj->set_reply_email($form_obj->get_reply_email());
$emform_obj->set_notify_email($emform_notify);
$emform_obj->set_emform_validation($form_obj->validation_rule);
$emform_obj->run();
So, I am just trying to figure out where I went wrong, or if there needs to be more information added somewhere.

Thanks,

Henry
Henry is offline   Reply With Quote
Old 12-12-2002, 08:00 AM   #7 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
cool, a vilitas customer =) we love vilitas around here hehe.

my guess is that your "$emform_path" variable is not set or wrong.

you may want to go to the top of the script and define the path to your "emform" directory.

those are basically saying that "thirdunitarianchurch.org/html/emform/emform_msg.php" is not valid.. is it? look at the entire path, and verify that all directories in that path are there.

thirdunitarianchurch.org -> html -> emform -> (the file ) emform_msg.php

let us know how it goes.
sde is offline   Reply With Quote
Old 12-12-2002, 02:46 PM   #8 (permalink)
Admin
$_['Your_Mom'];
 
Admin's Avatar
 
Join Date: May 2002
Location: Santee
Posts: 627
Admin is on a distinguished road
Quote:
Originally posted by sde
cool, a vilitas customer =) we love vilitas around here hehe.
damn straight!
__________________


Urban Clothing
Admin is offline   Reply With Quote
Old 12-13-2002, 01:25 AM   #9 (permalink)
mixingsoup
Registered User
 
Join Date: May 2002
Location: Christchurch, New Zealand
Posts: 10
mixingsoup is on a distinguished road
Send a message via AIM to mixingsoup Send a message via Yahoo to mixingsoup
CHMOD...

does this script in anway require that the dir/files be CHMODed to an apporiate setting?

BTW: I agree with sde it sounds like the directory address is not set correctly.
mixingsoup is offline   Reply With Quote
Old 12-13-2002, 08:46 AM   #10 (permalink)
Henry
Registered User
 
Join Date: Dec 2002
Location: Chicago
Posts: 13
Henry is on a distinguished road
directory address

I think that you are right about the directory address. I'm not at my computer right now, but I do remember that the emform_comfig file had clear instructions as to what needed to be entered for file path and URL, but I was not sure about one of the entries. It asked for Home/yourname/emform, and I was not sure what 'Home' meant, and what was meant by 'yourname' because the instructions stated 'username', 'dbname', 'password', 'domainname', 'operating system, yourURL, and so on. So I suspected that 'home' and 'yourname' were distinct from these other entries but I was not sure what they represented.

The other possibility may lie in the actual location of the file on the server. I ftp'd the file into a folder labeled 'thirdunitarianchurch', so in GoLive, I had to set the location of the file as: (web.vilitas)of course
thirdunitarianchurch.org/thirdunitarianchurch.org/emform. When I only had tuc.org listed once, I received an Apache error message that the file could not be found on that server. So is it possible that I have to set the file path for the emform file the same way?

Does any of this make sense?

Thanks,

Henry
Henry is offline   Reply With Quote
Old 12-13-2002, 08:49 PM   #11 (permalink)
technobard
Centurion Nova Prime
 
technobard's Avatar
 
Join Date: May 2002
Location: Oak Park, IL (USA)
Posts: 287
technobard is on a distinguished road
Henry? My immediate suggestion would be to create a simple php script just to make sure that everything is working properly on your site. I'll email you something on 12/14/02. Tell Linda I said hello. (just in case you don't know who this is)

On the other hand, take a look at this NUM:
http://codenewbie.com/num.php?id=9&page=num&num_id=14
technobard is offline   Reply With Quote
Old 12-13-2002, 09:35 PM   #12 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
hehe, i see what is wrong exactly now. the answer is right in your errors.

you are using this as your include path:
"/web.vilitas.com/thirdunitarianchurch.org/html/emform/"

when actually you need to use this for an absolute path: "/usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/"

i am 99% sure this will fix it.
sde is offline   Reply With Quote
Old 12-15-2002, 03:09 AM   #13 (permalink)
mixingsoup
Registered User
 
Join Date: May 2002
Location: Christchurch, New Zealand
Posts: 10
mixingsoup is on a distinguished road
Send a message via AIM to mixingsoup Send a message via Yahoo to mixingsoup
The answer lies within...
mixingsoup is offline   Reply With Quote
Old 12-16-2002, 07:39 PM   #14 (permalink)
Henry
Registered User
 
Join Date: Dec 2002
Location: Chicago
Posts: 13
Henry is on a distinguished road
Unfortunately, your suggestion sde did not work. You may find the change in the error message pasted below interesting though. Let me know if it sets any lights off. And thanks for trying.

Warning: Failed opening 'user2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/html/emform/emform_msg.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 3

Warning: Failed opening 'user2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/html/emform/emform_notify.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 4

Warning: Failed opening 'user2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/html/emform/emform_func.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 5

Warning: Failed opening 'user2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/html/emform/emform_class.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 6

Warning: Failed opening 'user2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/html/emform/library/class_template.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 7

Warning: Failed opening 'user2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/html/emform/library/class_template_db.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 8

Warning: Failed opening 'user2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/html/emform/library/sql_func.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 9

Warning: Failed opening 'user2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/html/emform/library/class_list.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 10

Warning: Failed opening 'user2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/html/emform/library/class_form_field.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 11

Warning: Failed opening 'user2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/html/emform/library/class_email_info.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 12

Warning: Failed opening 'user2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/html/emform/library/class_form_info.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 13

Warning: Failed opening 'user2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/html/emform/library/class_em_file.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 14

Fatal error: Cannot instantiate non-existent class: sql_class in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 30
Henry is offline   Reply With Quote
Old 12-16-2002, 08:01 PM   #15 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,532
sde is on a distinguished road
debuggin 101: don't take what we say word for word, try to understand "how" we are comming up with our guesses.

let's examine the first error which seems to repeat itself..

"Warning: Failed opening 'user2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/html/emform/emform_msg.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/emform.php on line 3 "

the first path is what it is trying to open ( and fails ), .. and the second path is exactly where it is at .. "/usr2/hsphere/home/thirdchu/thirdunitarianchurch.org/thirdunitarianchurch.org/emform/" try using that path. don't get intimidated by your errors, they tell you exactly what is going on. just read one section like the one i quoted above.

if you notice, those 2 paths in your error are different. you have an "html" directory in your path that does not exist. i can see this from the first 4 lines of your error which just repeats itself.

as mixingsoup said "the answer lies within"

good luck =)
sde is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
running a script at designated time tzarin PHP 5 05-12-2004 08:11 PM
PHP as CGI?? bdl PHP 8 05-08-2003 09:29 AM
cgi not working on a new script sde PHP 3 05-20-2002 09:29 PM


All times are GMT -8. The time now is 06:40 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting