<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP4 : Astuces de programmation Le MEMO du Web Développeur</title>
	<atom:link href="https://memo-web.fr/tag/php4/feed/" rel="self" type="application/rss+xml" />
	<link>https://memo-web.fr</link>
	<description></description>
	<lastBuildDate>Wed, 15 Apr 2020 07:13:27 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
	<item>
		<title>Fonction include() en PHP et URL externe</title>
		<link>https://memo-web.fr/categorie-php-199/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=categorie-php-199</link>
					<comments>https://memo-web.fr/categorie-php-199/#respond</comments>
		
		<dc:creator><![CDATA[t@ra]]></dc:creator>
		<pubDate>Sun, 30 Jun 2013 07:42:51 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[PHP4]]></category>
		<category><![CDATA[URL]]></category>
		<guid isPermaLink="false">http://memo-web.fr/?p=92</guid>

					<description><![CDATA[<p>Il est possible en PHP d&#8217;utiliser la fonction include() avec en paramètre, un fichier appelé par son URL. Exemple d&#8217;include avec URL&#160;absolue Cette possibilité semble être désactivée&#160;par défaut en PHP 5 (elle était couramment utilisée en PHP4). Cette méthode présente des risques de vulnérabilités&#160;et n&#8217;est pas recommandée, néanmoins si vous avez besoin, vous pouvez l&#8217;auroriser [&#8230;]</p>
The post <a href="https://memo-web.fr/categorie-php-199/">Fonction include() en PHP et URL externe</a> first appeared on <a href="https://memo-web.fr">Le MEMO du Web Développeur</a>.]]></description>
										<content:encoded><![CDATA[<p>Il est possible en PHP d&rsquo;utiliser la fonction include() avec en paramètre, un fichier appelé par son URL.</p>



<h2 class="wp-block-heading">Exemple d&rsquo;include avec URL&nbsp;absolue</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">&lt;?php include ('http://memo-web.fr/monfichier.php'); ?></pre>



<p>Cette possibilité semble être désactivée&nbsp;par défaut en PHP 5 (elle était couramment utilisée en PHP4).</p>



<p>Cette méthode présente des risques de vulnérabilités&nbsp;et n&rsquo;est pas recommandée, néanmoins si vous avez besoin, vous pouvez l&rsquo;auroriser en rajoutant dans votre fichier php.ini les directives suivantes :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">allow_url_include = 1
allow_url_fopen = 1 </pre>
<div style="margin-top: 0px; margin-bottom: 0px;" class="sharethis-inline-share-buttons" ></div>The post <a href="https://memo-web.fr/categorie-php-199/">Fonction include() en PHP et URL externe</a> first appeared on <a href="https://memo-web.fr">Le MEMO du Web Développeur</a>.]]></content:encoded>
					
					<wfw:commentRss>https://memo-web.fr/categorie-php-199/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Une fonction file_put_contents pour PHP4</title>
		<link>https://memo-web.fr/categorie-php-126/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=categorie-php-126</link>
					<comments>https://memo-web.fr/categorie-php-126/#respond</comments>
		
		<dc:creator><![CDATA[t@ra]]></dc:creator>
		<pubDate>Sun, 29 Jul 2012 13:48:34 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP4]]></category>
		<guid isPermaLink="false">http://memo-web.fr/?p=137</guid>

					<description><![CDATA[<p>file_put_contents() est une fonction PHP bien pratique pour écrire du contenu dans un fichier. Dans l&#8217;exemple ci-dessous, elle est utilisée pour insérer la phrase « Salut&#8216; dans le fichier&#160;monfichier.txt&#160;ce dernier étant placé dans le répertoire du fichier d&#8217;appel (le fichier qui contient l&#8217;appel à la fonction)Important&#160;: si monfichier.txt n&#8217;existe pas il sera créé Pour en savoir [&#8230;]</p>
The post <a href="https://memo-web.fr/categorie-php-126/">Une fonction file_put_contents pour PHP4</a> first appeared on <a href="https://memo-web.fr">Le MEMO du Web Développeur</a>.]]></description>
										<content:encoded><![CDATA[<p><strong>file_put_contents</strong>() est une fonction PHP bien pratique pour écrire du contenu dans un fichier.</p>



<p>Dans l&rsquo;exemple ci-dessous, elle est utilisée pour insérer la phrase « <strong>Salut</strong>&lsquo; dans le fichier&nbsp;<strong>monfichier.txt</strong>&nbsp;ce dernier étant placé dans le répertoire du fichier d&rsquo;appel (le fichier qui contient l&rsquo;appel à la fonction)<br>Important&nbsp;: si monfichier.txt n&rsquo;existe pas il sera créé</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">file_put_contents('monfichier.txt', 'Salut');</pre>



<p><a href="http://php.net/manual/fr/function.file-put-contents.php" target="_blank" rel="noreferrer noopener">Pour en savoir plus sur les paramètres de cette fonction</a>.</p>



<p>En PHP4<strong>&nbsp;file_put_contents</strong>()&nbsp;n&rsquo;existe pas&nbsp;!</p>



<h2 class="wp-block-heading">Fonction de remplacement de&nbsp;file_put_contents() en PHP4</h2>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">if (!function_exists('file_put_contents')) {
    function file_put_contents_PHP4($monfichier, $montexte) {
        $f = @fopen($monfichier, 'w');
        if (!$f) {
            return false;
        } else {
            $resultat= fwrite($f, $montexte);
            fclose($f);
            return $resultat;
        }
    }
}</pre>
<div style="margin-top: 0px; margin-bottom: 0px;" class="sharethis-inline-share-buttons" ></div>The post <a href="https://memo-web.fr/categorie-php-126/">Une fonction file_put_contents pour PHP4</a> first appeared on <a href="https://memo-web.fr">Le MEMO du Web Développeur</a>.]]></content:encoded>
					
					<wfw:commentRss>https://memo-web.fr/categorie-php-126/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
