-
Posts
840 -
Joined
-
Last visited
-
Days Won
1
Everything posted by gristoi
-
Ok, the final parameter you are pssing into the mail fucntion is for the headers. I am going to presume that $_POST[email] just returns the email address, and that you are using this as the 'from' field. What you need to do is build a correct header. so try this: $sendmail_from = 'From: '. { $email } ."\r\n";
-
you will need to be looking at using cron jobs to automaitcally excecute a pre defined script
-
Ok, It is telling you that you have not declared the $from variable.You have declared it as $sendmail_from , so your mail function should look like: Line 280: if(mail($to, $subject, $output, $sendmail_from)) Line 281: die("The e-mail was sent successfully.<br />$success"); Line 282: else Line 283: echo "Unable to send e-mail."; A little bit of advice aswell, when your posting your codee on the forum you need to make sure it is between the code tags ( the button for it has a hash symbol on it)
-
If your talking about Object Orientated Programming then search google or get a book on the subject from amazon. there are a lot of good online tutorials to get you started. You will also need to read up on Inheritence and Design Patterns
-
ok, a couple of issues. I cannot see your php as PHP is a server side scripting language. Which means it is not viewable in the browsers source view. You need to post the php here on the forum. To turn your error checking on you need to put this on the line below your opening php tag at the top of the page: <?php ini_set('display_errors',1); error_reporting(E_ALL|E_STRICT); this will force all error and warnings to be displayed. You said that you are getting an unable to send mail error, to diagnose the issue you really ned to post the php script here. But without seeing the php it could be that the web hosting you are using does not have email fucntionality.
-
Let's back track a bit, is this all you have in the file your testing? : <?php #!/usr/bin/php mysql_connect('localhost','usrname','pw') or die ('Error connecting'); ?> And if so what made u sure it was working in the browser ?
-
Is your lamp server on the same pc u are trying run the php script from. And I don't want to sound rude but if you've been using and building lamp stacks fe years you would know that phpmyadmin is only a GUI for the mysql server. Which means that if it is on your pc then you shouldn't be having this problem as running via command line is making exactly the call to the mysql server
-
Well, it's telling u that u do not have mysql installed. How exactly did u install your 'lamp' server ? I would first google how to install and configure a lamp server, then once you Definately have php AND mysql installed, retry your connection. If it still does not work , repost here
-
I read Pro Zend Framework CMS: Building a full CMS using Advanced Aspects of the Zend Framework [Paperback]. which encompassed most of the mvc principles
-
Have u checked that your mysql is installed? and that the extension is enabled correctly. what happens when you open up a terminal window in ubuntu and type mysql -v
-
I built my own bespoke MVC framework, not to reinvent the wheel but to learn the benifits of using such a framework. It gave me a much better understanding of how to approach coding using solid design patterns and principles. And i do agree with you that some frameworks can seem over bloated. I have worked on a few zend applications, and although I highly reccomend the framework I have found it frustratingly over complicated sometimes. I use my own framework all the time now and find I can build an application / site twice as fast compared to no framework. With the use of naming conventions, structure and a solid methodology it makes life so much easier. And easily scalable
-
post your script here
-
if your php script contains your mysql connection details and a valid connection the the database then all you need to do is point a cron to your script: 1. open a terminal 2. open a cron editor, i use crontab -e 3: use the following format : taken from http://adminschoice.com/crontab-quick-reference * * * * * command to be executed - - - - - | | | | | | | | | +----- day of week (0 - 6) (Sunday=0) | | | +------- month (1 - 12) | | +--------- day of month (1 - 31) | +----------- hour (0 - 23) +------------- min (0 - 59) so for a php script that runs at 17:00 every day: * 17 * * * php /path/to/your/script.php
-
What is an effective way of passing a large array to a class?
gristoi replied to mag0103's topic in PHP Coding Help
PHP thrives on array manipulation. Just pass the array into the class using getters and setters. in your class you can pull the data in through the set: <?php class test { private $_emailArray; public function setEmailArray( $array ) { $this->_emailArray= $array ; } public function getEmailArray() { return $this->_emailArray; } ?> this will allow the array to be passed into and returned from the class. note that you do not need to use the get functionality within the class, -
with wghet you normally dont need the http part. so try wget www.website.com/filename.php
-
your loop after the query is unsetting any keys from the resulting array if there is no value for it. So not every field could have a value. but as you query is pulling all of the field you ask for already then you just need to call like this example: <?php if( $result = mysql_query($query) ) { echo mysql_error(); while($row = mysql_fetch_assoc($result) ) { $name = $row['name']; $phone = $row['phone']; $email = $row['email']; $webaddress= $row['WebAddress']; foreach( $row as $k => $v ) { if( empty($v) ) { unset($row[$k]); } } if( !empty($row['postcode']) ) { $row['postcode_link'] = "<p class=link><a href='/gmap.php?postcode=" . urlencode($row['postcode']) . "'>Map</a></p><br>"; } echo implode( '<br>', $row); } } ?>
-
Ok, I think you are missing the point slightly. You do not use your ISP's I.P address as an email server. You use the ips's email server as an email server !!!!. Now as you stated: So I am not going to give you the mail server settings for qwest as the connection is not owned by You, and if i found someone else using my internet connection as a mail server i wouldnt be too happy. But a quick google for qwest outgoing mail servers will point you in the right direction. But what i really advise is for you to go online an get yourself some hosting. All the setup info you need to get this working is in the previous posts i sent you, yet you have not followed the information correctly once. So PLEASE READ THE POST THOUROUGHLY before we start going round in circles. I am trying to help you as much as possible, but your not giving me much to work with
-
you havent changed anything ! your smtp server still says localhost and your sendmail_from still says you@yourdomain. what exactly have you changed.?
-
where to post for dreamweaver with php help
gristoi replied to aprilpgb22's topic in PHP Installation and Configuration
ok, the easiest way is to store your files in the root folder. 1. create a new folder in c:\wamp\www called test. 2. open dreamweaver and create a new site. for the local file location point it to c:\wamp\www\test 3. create an index.php file in dreamweaver 4. add some code to test <?php echo 'it works woo hoo'; ?> 5. save and open your browser. go to http://localhost/test you should see your new file -
you will find that errors of this nature are not usually on the line in question. what is on the lines preceding this one?
-
where to post for dreamweaver with php help
gristoi replied to aprilpgb22's topic in PHP Installation and Configuration
Which directory are your files in at the moment? -
If you installed wamp using the default location then wamp would have installed to c:\wamp and not into the normal program files folder. just delete c:\wamp then reinstall. BUT BEFORE YOU DELETE THIS FOLDER ENSURE YOU HAVE REMOVED ANYTHING YOU NEED FROM THE c:\wamp\www folder. !!!!!!!
-
Dont link the anchor directly to the file: <a href="link/to/file.doc">Download</a> instead send it to a function that will check if the user is logged in, <a href="http://mysite.com/downloadfiles.php?downloaddoc = doc.doc">Download</a> then within a function on the page you have sent the link to fetch the file using file_get_contents or another similar method, then within the function push the file to the browser with the correct headers.
-
Great quiz !!. Especially like the way u used clicking on certain parts of the image for the answer. Good luck with the rest