Don't know where to start: php script to update a website

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
simon_porter00
Forum Newbie
Posts: 13
Joined: Thu Feb 25, 2010 1:25 pm

Don't know where to start: php script to update a website

Post by simon_porter00 »

Hello All,
First of all, sorry for asking for help on a first visit.

I'm going round in circles trying to find out exactly what php script I need to create a webpage I'm planning to develop.
Basically, it's a classifieds web page, a "service required" (i.e. people looking for help) ad listing.
A person would enter their details as to what they want by ticking a number of tick boxes and by filling out fields - name, email, extra info etc
This information when submitted would then update another page which is chosen by the location they filled out in the initial form.

I would also like for results to be shown to them of all the possible 'matches' of service providers they could have dependent on the criteria they selected.

If anyone could tell me what I need, what type of script will help me that I could try to modify to suit my own goals, I'd be incredibly grateful.

Many thanks,
Simon
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Don't know where to start: php script to update a website

Post by AbraCadaver »

I can't vouch for any of them, but pick a few and test them out: http://www.google.com/search?q=free+php ... eds+script
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
jraede
Forum Contributor
Posts: 254
Joined: Tue Feb 16, 2010 5:39 pm

Re: Don't know where to start: php script to update a website

Post by jraede »

I created my own for my website, NiteFlip.com, to transfer files over from my dev folder to the webroot folder. Check it out, see if you can use it.

Code: Select all

 
function publish_directory($dir) {
    $dir_old = $_SERVER['DOCUMENT_ROOT'] . '/development/' . $dir . '/';
    $dir_new = $_SERVER['DOCUMENT_ROOT'] . '/webroot/' . $dir . '/';
    if (is_dir($dir_old)) {
        if ($dh = opendir($dir_old)) {
            while (($file = readdir($dh)) !== false) {
                if(is_dir($dir_old . $file)) {
                    continue;
                }
                else if($file == 'config.php') {
                    continue;
                }
                else {
                    $old = $dir_old . $file;
                    $new = $dir_new . $file;
                    copy($old, $new) or die("Unable to copy $old to $new.");
                    echo "Publishing " . $dir . '/' . $file . '<br />';
                }
                
            }
            closedir($dh);
        }
    }
}
 
$dir is just the name of the folder. So, underneath this function declaration, I have, for example:

Code: Select all

 
publish_directory('config');
publish_directory('handlers');
publish_directory('handlers/ajax');
publish_directory('includes');
publish_directory('includes/classes');
 
...etc. Hope this helps.
Post Reply