hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : php script
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

php script

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 06-07-2005, 08:06 PM
hoachen hoachen is offline
WHT Addict
 
Join Date: Jun 2005
Posts: 146

php script


Anybody spot the problems? I keep getting the error message "Notice: Undefined index: practiceopportunities in d:\....\contact\contact.php on line 147 or Undefined index: recruitingservices in line 146

Please help!



<?php


144 $Message .= "Phone Number: " . $_REQUEST["phone"] . "\n";

145 $Message .= "Fax: " . $_REQUEST["fax"] . "\n";

146 $Message .= "Interest: " . $_REQUEST["recruitingservices"] . "\n";

147$Message .= "Interest: " . $_REQUEST["practiceopportunities"] . "\n";
$Message .= "Others: " . $_REQUEST["comments"] . "\n";

mail("hoachen@hotmail", "Contact Form Submission", $Message) or
Die("Error Sending Mail");

echo "Your information was submitted successfully..."
?>

here is the html

<input name="recruitingservices" type="checkbox" value="I’m interested in recruiting services for my hospital, clinic, or other medical organization." >
I’m interested in recruiting services for my
hospital, clinic, or other medical organization. </p></td>

<input name="practiceopportunities" type="checkbox" value=" I’m a physician interested finding new practice opportunities" >
I’m a physician interested finding new practice
opportunities </p></

Reply With Quote


Sponsored Links
  #2  
Old 06-07-2005, 09:27 PM
VolkNet VolkNet is offline
Web Hosting Master
 
Join Date: Jun 2004
Location: Bay Area -USA
Posts: 1,738
Maybe you could use post instead?
144 $Message .= "Phone Number: " . $_POST["phone"] . "\n"; etc.

It's the only thing I could think of.

__________________
<<< Please see Forum Guidelines for signature setup. >>>

Reply With Quote
  #3  
Old 06-07-2005, 09:28 PM
ausBorne ausBorne is offline
Newbie
 
Join Date: May 2005
Posts: 8
Try this in your script:

PHP Code:
error_reporting(E_ALL E_NOTICE); 
If that fails, you will need to set the error_reporting in your php.ini file.

Reply With Quote
Sponsored Links
  #4  
Old 06-08-2005, 01:26 PM
hoachen hoachen is offline
WHT Addict
 
Join Date: Jun 2005
Posts: 146
Thank you for the advice I've tried it but still doesn't work!

Quote:
Originally posted by VolkNet
Maybe you could use post instead?
144 $Message .= "Phone Number: " . $_POST["phone"] . "\n"; etc.

It's the only thing I could think of.

Reply With Quote
  #5  
Old 06-08-2005, 02:12 PM
Carl V Carl V is offline
Newbie
 
Join Date: Jun 2005
Posts: 16
That is not an error, but rather a notice.

It means that in the $_POST array, there is no index of recruitingservices or practiceopportunities.

Try putting this in:

PHP Code:
print "<pre>";
print_r($_POST);
print 
"</pre>"
That will print out the $_POST array.

Additionally, you can do the following to "surpress" that error.

PHP Code:
if (isset($_POST["recruitingservices"]))  $Message .= "Interest: " $_POST["recruitingservices"] . "\n";

if (isset(
$_POST["practiceopportunities"])) $Message .= "Interest: " $_POST["practiceopportunities"] . "\n"

Reply With Quote
  #6  
Old 06-08-2005, 02:28 PM
giggss giggss is offline
Newbie
 
Join Date: Jun 2003
Posts: 18
Did u uncheck the box? If u uncheck the checkbox, this variable will not be posted / sent to your PHP page, therefore u have the undefined index.

Reply With Quote
  #7  
Old 06-08-2005, 04:30 PM
hoachen hoachen is offline
WHT Addict
 
Join Date: Jun 2005
Posts: 146
thank you Carl. I will try it when i get back to the office. One more question Inside one of my form contain a field that let user to upload they data file and submit to my specific email address which i specify in my php code. The problem is I get the all data but not the uploaded file. I used $message .= "File Upload: " ._$Post ['file_upload']. Any suggestion to fix this so that i can get data the user enter plus the attach file from the user?

Reply With Quote
  #8  
Old 06-08-2005, 04:34 PM
Carl V Carl V is offline
Newbie
 
Join Date: Jun 2005
Posts: 16
Quote:
Originally posted by hoachen
thank you Carl. I will try it when i get back to the office. One more question Inside one of my form contain a field that let user to upload they data file and submit to my specific email address which i specify in my php code. The problem is I get the all data but not the uploaded file. I used $message .= "File Upload: " ._$Post ['file_upload']. Any suggestion to fix this so that i can get data the user enter plus the attach file from the user?
Are you having trouble uploading the file? or getting the filename?

If you want to upload a file, try this.

Reply With Quote
  #9  
Old 06-08-2005, 04:55 PM
hoachen hoachen is offline
WHT Addict
 
Join Date: Jun 2005
Posts: 146
i mean already been uploaded from the form and when click on submit, php will process it and send all the data to my email. so i can view it on my mail box just like receive an email from somebody. Anybody have any advice i will very appriciated your knowledge.

Reply With Quote
  #10  
Old 06-08-2005, 05:08 PM
Carl V Carl V is offline
Newbie
 
Join Date: Jun 2005
Posts: 16
This is the best I could find: http://www.phpguru.org/static/mime.mail.html for dealing with attachments on the mail() command.

Reply With Quote
  #11  
Old 06-08-2005, 05:11 PM
hoachen hoachen is offline
WHT Addict
 
Join Date: Jun 2005
Posts: 146
alright, i will try see what i can get. Thanks. Have a good one

Reply With Quote
  #12  
Old 06-09-2005, 10:21 PM
TimSG TimSG is offline
Junior Guru Wannabe
 
Join Date: May 2005
Posts: 67
If you're trying to send email with mime attachments with PHP, I'd urge you to check out the PEAR repository. I'm quite sure someone has already written a class or three to do this. (pear.php.net).

__________________
Game control panels - control your game world your way. Server-Genie.com
http://www.server-genie.com

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Pingdom Talks Top Web Hosting Cities and Countries Web Hosting News 2013-03-27 18:49:54
Whistleblower Site Cryptome Hacked, Infects PCs with Drive-By Exploits Web Hosting News 2012-02-14 14:48:24
Control Panel cPanel Launches New Apache Configuration Script Web Hosting News 2011-12-28 19:41:39
Web Host HostingZoom Adds Softaculous Auto-Installer to Hosting Plans Web Hosting News 2011-08-17 17:52:34
Web Host JaguarPC Adds Auto-Installer Softaculous to Hosting Plans Web Hosting News 2011-07-27 18:55:46


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

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 Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?