note 54511 added to function.require

From: Date: Wed, 06 Jul 2005 18:54:38 +0000
Subject: note 54511 added to function.require
Groups: php.notes 
Request: Send a blank email to php-notes+get-91546@lists.php.net to get a copy of this message
Something which may not be immediately obvious is that if you use double quotes on the filename, you can use variables to specify the filename, allowing you to do something like this: <?php $query = "SELECT filename FROM updates WHERE version>$current ORDER BY version"; $updateresult = mysql_query($query) or exit($query.'<br />'.mysql_error()); while ($updaterow = mysql_fetch_row($updateresult)) { require "$updaterow[0]"; } ?> Drop this in a script on a server and you can push updates to your clients. Obviously, make sure you only run scripts you want to. ---- Manual Page -- http://www.php.net/manual/en/function.require.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+54511 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54511&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54511&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54511&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54511&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54511&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54511&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+54511&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#91546) next »