Jump to content

gristoi

Members
  • Posts

    840
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by gristoi

  1. 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)

  2. 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.

  3. 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 ?

  4. 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

  5. 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

  6. 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

  7. 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

  8. 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,

  9. 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);
    }
    }
    ?>
    

  10. 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:

    I don't have internet i use wireless thru someone else in my apartment complex  cuz its an unlocked connection. honestly i don't even know who it belongs to  i just know that his internet provider is qwest. so i did the following and i still got the error.

    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

  11. 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

  12. 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.

×
×
  • 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.