Jump to content

bmobm

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Everything posted by bmobm

  1. Thats it........ Yay lol. perfect. all working perfect now, thank you very much for your help. i have just 1 more question for you. ive been searching all last night for the answer but i need it in laymans terms, i need to add an attachment feield to the form, so it does either 1 of 2 things, first i would like it to attach a file (C.V for employment) and send it with the email to me or it should upload it to my server and a link to the attachment in the email i receive so i can go and retreive it. can you help me with this please???
  2. New code: <?php$ip = $_POST['ip'];$httpref = $_POST['httpref'];$httpagent = $_POST['httpagent'];$visitor = $_POST['visitor'];$visitormail = $_POST['visitormail'];$visitorcontactnumber = $_POST['visitorcontactnumber'];$companyname = $_POST['companyname'];$attn = $_POST['attn'];$notes = $_POST['notes'];if (eregi('http:', $notes)) {die ("Do NOT try that! ! ");}if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,"."))){echo "<h2>Please Use Back Button - Enter valid e-mail</h2>\n";$badinput = "<h2>Your message was NOT submitted</h2>\n";echo $badinput;die ("Go back! ! ");}if(empty($visitor) || empty($visitormail) || empty($visitorcontactnumber) || empty($notes )) {echo "<h2>Use Back - fill in all fields</h2>\n";die ("Use back! ! ");}$todayis = date("l, F j, Y, g:i a") ;$attn = $attn ;$subject = $attn;$notes = stripcslashes($notes);$message = " $todayis [EST] \nAttention: $attn \nMessage: $notes \nFrom: $visitor ($visitormail)\nContact Number: $visitorcontactnumber \nCompany Name: $companyname \nAdditional Info : IP = $ip \nBrowser Info: $httpagent \nReferral : $httpref \n";$from = "From: $visitormail\r\n";mail("[email protected]", $subject, $message, $from, $visitorcontactnumber, $companyname);?><p align="center">Date: <?php echo $todayis ?><br />Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> )<br />Company Name: <?php echo $companyname ?><br />Contact Number: <?php echo $visitorcontactnumber ?><br />Attention: <?php echo $attn ?><br />Message:<br /><?php $notesout = str_replace("\r", "<br/>", $notes);echo $notesout; ?><br /><?php echo $ip ?><br /><br />Your message has been submitted. Please click here to return to the previous page<br /> <a href="contact.php"> Back </a></p>
  3. Ok, i got it now, ive fixed it, apart from 1 more problem with this perticular form, im now getting an error of "Warning: mail() expects at most 5 parameters, 6 given in /home/tlkdirec/public_html/sendeail.php on line 148" I know its because ive added an extra field but i cannot for the life of me find where i change the perameters from 5 to 6.
  4. But thats wat i already have isnt it? $from = "From: $visitormail\r\n"; mail("[email protected]", $subject, $message, $from, $visitorcontactnumber); ?>
  5. Ok, this is the situation, I have a form to email script installed on my website, (im not the best with PHP but im learning) I managed to adapt the main contact form to meet my needs however i am now having a few probs, basically the script i am using is IBDhost Contact Form. The basic code consits of 4 fields, name field, email field, subject dropdown box and message text box. On my site i need to adapt the form to incorporate additional fields, which are for the first form..... name field (compulsory), COMPANY name field (non compulsory), valid email (compulsory), contact number (compulsory), Department dropdown box ( i want this to determin what mailbox the message gets sent to, so rather than just 1 email address for all messages to go to, i want the user to determine where the email goes through a variety of email address options) and the main message text box. The second difference i need is for a different page, using the same form, but with different fields, Name field (compulsory), Contact Number (compulsory) email address (compulsory) message text box area(non compulsory) and an attachment upload field. I need the attachment upload to be able to do 1 of 2 things, either send the attachment along with the email, OR upload the email to a directory on my server BUT have the form details include a link to the form when i receive it. basically it will be used for C.V uploads for jobs. The code i am using is shown below ... FORM CODE: <form method="post" action="sendeail.php"> <!-- DO NOT change ANY of the php sections --> <?php $ipi = getenv("REMOTE_ADDR"); $httprefi = getenv ("HTTP_REFERER"); $httpagenti = getenv ("HTTP_USER_AGENT"); ?> <input type="hidden" name="ip" value="<?php echo $ipi ?>" /> <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" /> <input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" /> Full Name: <br /> <input type="text" name="visitor" size="35" /> <br /> Valid Email:<br /> <input type="text" name="visitormail" size="35" /> <br /> Contact Number:<br /> <input type="text" name="visitorcontactnumber" size="35" /> <br /> <!-- BELOW IS WHERE I WANT THE USER TO BE ABLE TO PICK A DEPARTMENT BUT INSTEAD OF THAT BEING THE ATTENTION TO SUBJECT, I WANT IT TO SEND IT TO THE RELEVENT EMAIL ADDRESS --> Attention:<br /> <select name="attn" size="1"> <option value=" Administration ">Administration </option> <option value=" Existing Clients ">Clients (existing) </option> <option value=" New Client Enquiry ">Clients (new) </option> <option value=" Director Of Sales And Marketing ">Sales Director </option> <option value=" General Enquiries ">General Enquiries </option> <option value=" Site Support ">Site Support </option> <option value=" Recruitment ">Recruitment </option> <option value=" Web Master ">Webmaster </option> </select> <br /><br /> Message (please include company details if a client): <br /> <textarea name="notes" rows="6" cols="60"></textarea> <br /> <input type="submit" value="Send Mail" /> <br /> </form> SENDEAIL.php code <?php $ip = $_POST['ip']; $httpref = $_POST['httpref']; $httpagent = $_POST['httpagent']; $visitor = $_POST['visitor']; $visitormail = $_POST['visitormail']; $visitorcontactnumber = $_POST['visitorcontactnumber']; $attn = $_POST['attn']; $notes = $_POST['notes']; if (eregi('http:', $notes)) { die ("Do NOT try that! ! "); } if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,"."))) { echo "<h2>Use Back - Enter valid e-mail</h2>\n"; $badinput = "<h2>Your message was NOT submitted</h2>\n"; echo $badinput; die ("Go back! ! "); } if(empty($visitor) || empty($visitormail) || empty($visitorcontactnumber) || empty($notes )) { echo "<h2>Use Back - fill in all fields</h2>\n"; die ("Use back! ! "); } $todayis = date("l, F j, Y, g:i a") ; $attn = $attn ; $subject = $attn; $notes = stripcslashes($notes); $message = " $todayis [EST] \n Attention: $attn \n Message: $notes \n From: $visitor ($visitormail)\n Additional Info : IP = $ip \n Browser Info: $httpagent \n Referral : $httpref \n "; $from = "From: $visitormail\r\n"; mail("[email protected]", $subject, $message, $from, $visitorcontactnumber); ?> <p align="center"> Date: <?php echo $todayis ?> <br /> Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> ) <br /> Attention: <?php echo $attn ?> <br /> Message:<br /> <?php $notesout = str_replace("\r", "<br/>", $notes); echo $notesout; ?> <br /> <?php echo $ip ?> <br /><br /> <a href="contact.php"> Back </a> </p> the only problem i have with the form i have adapted so far is that all the details are coming through on the message to my email apart from the additional field (contact number) so im obviously missing something there as well. I would really appreciate any help. And i hope in the future i can assist someone on here too.
  6. Ok ,ive got it narrowed down to this: it seems that the scripts require a defined constant and i need to ensure that other files are also included, which isnt happening at the moment. so i will need to somehow make sure those other files are in the proper directory for inclusion by the header/footer, either by manually editing the header/footer, or moving the files to a different directory, which could then break even more stuff. lol somebody on another forum suggested that but being new to all this i dont actually know what he means. BUT ive come up with a plan.............. what do you think about this idea???? would it work if i copied the probid directory structure (just the files and folders which the includes are trying to call) to the ROOT. in the same structure as they are in the probid directory. thus making the index (which is in the ROOT) think its still inside the probid directory, and if i only call the files which i need for the index then this shouldnt use up to much space.......... is this right? but would i need to modify any settings for the database or will it still be able to find the database from either directory? (i think thats a question for the MySQL forum lol. )
  7. ive just tried this: <?php include ("/home/username/public_html/header.php"); include ("/home/username/public_html/mainpage.php"); include ("/home/username/public_html/footer.php"); ?> but im getting errors still, as shown below by the way what does open_basedir restriction in effect mean?
  8. the files i want to include mainly are these files include_once ("config/config.php"); include ("themes/".$setts['default_theme']."/header.php"); include ("themes/".$setts['default_theme']."/footer.php"); ?> so if my directory for the themes is mysite.co.uk/subdirectory/themes.choosen_theme/file.php and i want to include the files to a document in mysite.co.uk do i change the include to include ("../subdirectory/themes/".$setts['default_theme']."/header.php"); and include ("../subdirectory/themes/".$setts['default_theme']."/header.php"); oh ive just noticed something also there is a MySQL query in there aswell isnt there? for the defult theme. would i need to make any amendments for that to work or should it still work?
  9. would it work if i for example took a page from inside the script directory (copied it) and put it in the ROOT directory and then just changed the path to the includes ie include("../subdirectory/themes/chosen theme/file.php") understanding that "../" means the directory the file USING the includes is in Is it possible that the files have some protection to stop them being callef outside of the directory they are intended to be used in?? if si is there a way around this?
  10. but i thought that would only work from within the directoy the other files which call the files i want reside in. ../ i thought meant the directory the files are in and the /folder/folder/file.php path to the one i want? Does this still work when calling files to a files outside of this directory? To be honest its almost like a chmod prob if you get what i mean. its like the files im trying to call are protected from being called or linked to from out side the probid directory. am i making sense here?
  11. when you visit www.mysite.co.uk its redirected to a sub directory of www.subdirectory.mysite.co.uk i need to call files from www.mysite.co.uk/subdirectory/themes/chosen_theme/ to an index which will be in the ROOT directory which is 1 level up from the subdirectory does this make sense? click HERE for a rough idea of what i mean
  12. I have a website which is running PHPProbid. I have tried to register on their forums but after 3 weeks of trying i am giving up in the hope that someone else may be able to assist me with my problem. My directory is similer to this: ROOT | | ------------------- | | | | probid folder | | | | another folder another folder example here (this will give you a better idea of what it looks like and what i mean) Any way i want tp put an index file in the ROOT folder which calles files from within the probid folder. i.e. the header and footer and main categories which appear on the left side of the pages. basically i want the index (which will be outside of the probid directory) to look like THIS which is IN the probid directory. But i dont what the log in our register boxes in the main part of the page just what you can see header, left side and Footer. I have tried to link to these pages but i am getting a permissions error and i have tried just about every thing my personal knowledge of PHP can do (which isnt much lol) I realise that i will also need some help with MySQL also as the categories and the login ect work via that but i will sort that once i have managed to make the index with a header, footer and the side bar. If any one can help me out i would be very greatful. Thank you all in advance
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.