Jump to content

jordan21

Members
  • Posts

    17
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Manchester, UK

jordan21's Achievements

Newbie

Newbie (1/5)

1

Reputation

  1. I think my brain died on me for a minute, I've obviously spent to long working on this assignment without a break! No catches, no overhead from additional packets, just simple old division 124 divided by 4135. Came to me about 15 mins after I started this thread . Nevermind
  2. Hi everybody I'm working on a uni assignment at the moment and I'm struggling a bit with the math on a particular question: Assuming that you have an internet connection that is capable of downloading 4135 kilobytes per second, how long would it take to download a 124 kilobyte file. Math has never really been my strong point, so I'm really struggling to get my head round this. I'm not looking for anybody to answer the question for me, but if somebody could point me in the right direction as to what I need to do to work this out then I would really appreciate it. Thanks!
  3. Maybe do a small open source project and put it on Git. That way when you're applying for jobs you can include a link to your project page on Git in your CV so the employer can see a sample of your code.
  4. Why should the OP be an expert in php just because they studied CS at university? I'm studying for a BSc in software engineering, and my friend is studying for a BSc in computer science, and php is not taught in either of our courses. Most CS/Software Engineering degrees teach ASM. C. C++ and Java. What's wrong with using frameworks? I agree with what you say about hitting the books hard and writing code all of the time, but the vast majority of PHP jobs require at least some knowledge and experience of the big frameworks (Zend, Symphony 2, Yii, etc). Personally, I like using frameworks, it means I can spend less time on the boring 'boiler plate' code and more time on the interesting stuff. @ecy5maa I've not taken the ZCE exam myself, but I'm thinking about it. I know a couple of people that have, and they think it was worth it. As for whether it'll improve employment prospects, I don't know, but it can't hurt! I think as far as studying goes the best place for information would definitely be the php manual (naturally!), and it might be worth looking at this: http://www.slideshar...tification-test, it gives some examples of test questions for the PHP 5.3 certification.
  5. I've just found this http://stackoverflow.com/questions/4963688/how-to-send-email-from-php-without-smtp-server-installed on stack overflow, it explains how to use phpmailer, it looks like it could be a much easier option for you than having to mess about getting sendmail + mailutils configured on your own system. All you need is a gmail account and you can send email using google's smtp servers. You can get phpmailer here http://code.google.com/a/apache-extras.org/p/phpmailer/downloads/list
  6. If you look at the requirements page on the php manual, it says that php needs to have access to the sendmail binary on your system in order for the mail() function to work properly. when it says that there are no installations required, it means that you do not need to install any additional modules as the mail() function itself is part of the php core. http://gr2.php.net/manual/en/mail.requirements.php
  7. http://www.mydigitallife.info/how-to-send-an-email-mail-message-from-linux-command-line-shell/ Try sending an email from the command line and see if that works. If it does then I'm assuming it's something in your php.ini that hasn't been set right thats stopping the mail() function from sending emails, if it doesn't then it could be a problem with the way that sendmail has been configured...
  8. It sounds like you don't have any SMTP server installed on your system, which is why the script isn't working for you. Your best bet is to install postfix. If you go to this link https://help.ubuntu.com/community/Postfix it talks you through installing postfix (SMTP server) on ubuntu step by step, and it shows you how to configure it correctly aswell. After you've got this installed the script should (in theory!) work fine.
  9. are you running on a windows or a linux system? and do you actually have an smtp server like sendmail installed?
  10. Hmm... strange :-\ are you testing this on your own dev environment or on your web host?
  11. No problem I'm on a shared host, so I've not got direct access to php.ini, but when I do phpinfo(); it shows I have the following mail settings: sendmail_path = /usr/local/bin/sendmail (this varies depending on your server setup) sendmail_from = not set SMTP = localhost smtp_port = 25 Are you getting any error messages or warnings at all when you run the script with error reporting on, or is it just saying "Failed to send email!"?
  12. Sorry for the confusion, I think I miss read your original post, I thought that you wanted to create a form on your website that will let you send emails to people. Now that I've re read your posts I think what you want is a contact form so that visitors to your site can fill out a contact form which will send an email to you, is that correct? if yes, then I've modified the code a little bit and it should work for you now: <?php error_reporting(E_ALL); class Emailer { private $sender; private $recipient; private $subject; private $body; public function __construct($sender) { $this->sender = $sender; } public function setSubject($subject) { $this->subject = $subject; } public function setRecipient($recipient) { $this->recipient = $recipient; } public function setBody($body) { $this->body = $body; } public function sendEmail() { $result = mail($this->recipient, $this->subject, $this->body, "From: $this->sender \r\n"); if (!$result) { echo "Failed to send email!"; } else { echo "Email sent successfully!"; } } } $sender = htmlspecialchars($_POST['from_email']); $recipient = "you@youremail.com"; $subject = htmlspecialchars($_POST['subject']); $body = htmlspecialchars($_POST['body']); $myEmail = new Emailer($sender); $myEmail->setSubject($subject); $myEmail->setRecipient($recipient); $myEmail->setBody($body); $myEmail->sendEmail(); ?> Just make sure that the input field names that you use in your contact form match what's at the bottom of the script and that the form method is set to "post". If your still having problems getting it working then let me know.
  13. Hi Can you post the complete code for watch.php. I'm at work at the moment, but I'll be able to have a proper look at it when I get home in a couple of hours. Thanks
  14. That's strange... I've just tested the code again on my server with error reporting turned on and I haven't got any errors or warnings and the email was sent fine, did you copy and paste the code I posted? in my php.ini I have SMTP set to localhost and SMTP_PORT set to 25, are you sure that you have the correct SMTP server and port settings for your web host in your php.ini? and also, are you setting the from address as an email address that actually exists on your domain (e.g you@yourdomain.com)?
×
×
  • 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.