<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3681402488843432710</id><updated>2024-08-31T19:51:05.232+02:00</updated><category term="php"/><category term="svenska"/><category term="php för svenska"/><category term="php på svenska"/><category term="phpfunktioner"/><category term="Installera Wordpress"/><category term="Logga in script"/><category term="Lära sig php"/><category term="Lära sig php på svenska"/><category term="Mail"/><category term="Php bilder"/><category term="Php logga in"/><category term="Wordpress"/><category term="Wordpress guide"/><category term="Wordpress lathund"/><category term="Wordpress på svenska"/><category term="anslut till mysql php"/><category term="blob databas"/><category term="bygg"/><category term="css filer"/><category term="custom css"/><category term="dynamisk"/><category term="dynamisk php"/><category term="dynamiska php menyer"/><category term="facebook"/><category term="facebook app"/><category term="facebook logga in"/><category term="facebook php"/><category term="flera css i en"/><category term="funktioner"/><category term="google"/><category term="guide"/><category term="import css"/><category term="importera css"/><category term="kod"/><category term="ladda upp bilder i php"/><category term="lathund"/><category term="log in script php"/><category term="lär dig php"/><category term="mail script php"/><category term="mysql"/><category term="mysql logga in script"/><category term="mysql php"/><category term="php menyer"/><category term="php mysql logga in"/><category term="php svenska"/><category term="phpmyadmin"/><category term="script"/><category term="svensk php"/><category term="tutorial"/><category term="virtuell server php svenska"/><category term="virtuell server svenska"/><category term="väder"/><category term="xampp på svenska"/><title type='text'>Svensk PHP-Programmering</title><subtitle type='html'>På Svenskphp kan du enkelt hitta beskrivningar och php-scripts på svenska</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://svenskphp.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://svenskphp.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>JohannesMattsson</name><uri>http://www.blogger.com/profile/15885527309233775321</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtvwYLqczGjKRZuVnHooye5CM0j_nb-pF5vPHCFs3OMyEamHoYrneix3Mo_NiCSjhmV41MzNwmNbanzHf0MYtAGEr44JBBAnIkj_9QNpbDWwbVNZxv8FrdaitNww19hDY/s220/DSC05037jhvgjhv.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3681402488843432710.post-1204561057193161779</id><published>2012-11-06T23:57:00.000+01:00</published><updated>2012-11-06T23:59:33.081+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="css filer"/><category scheme="http://www.blogger.com/atom/ns#" term="custom css"/><category scheme="http://www.blogger.com/atom/ns#" term="flera css i en"/><category scheme="http://www.blogger.com/atom/ns#" term="import css"/><category scheme="http://www.blogger.com/atom/ns#" term="importera css"/><title type='text'>Importera CSS-filer i CSS</title><content type='html'>Ibland vill man strukturera upp sina .css filer i sin hemsida.&lt;br /&gt;
&lt;br /&gt;
Låt oss säga att du har main.css:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;body{&lt;/b&gt;&lt;br /&gt;
background-color:#fff;&lt;br /&gt;
&lt;b&gt;}&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;p{&lt;/b&gt;&lt;br /&gt;
color:#fff;&lt;br /&gt;
&lt;b&gt;}&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;.navigation{&lt;/b&gt;&lt;br /&gt;
float:left;&lt;br /&gt;
&lt;b&gt;}&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;p{&lt;/b&gt;&lt;br /&gt;
color:#000;&lt;br /&gt;
&lt;b&gt;}&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Skapa nu två nya css filer som heter exempelvis navigation.css och custom.css&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Flytta över &lt;b&gt;.navigation{float:left;}&lt;/b&gt; till den nya &lt;i&gt;navigation.css&lt;/i&gt; filen, vice versa med &lt;b&gt;p{color:#000}&lt;/b&gt; till &lt;i&gt;custom.css&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gå tillbaka till din main.css och ändra så det ser ut såhär:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;body{&lt;/b&gt;&lt;br /&gt;
background-color:#fff;&lt;br /&gt;
color:#fff;&lt;br /&gt;
&lt;b&gt;}&lt;/b&gt;&lt;br /&gt;
/* CSS för navigation */&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;@import url(&#39;&lt;/b&gt;navigation.css&lt;b&gt;&#39;);&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*CSS för custom, måste ligga längst ner för att skriva över resten*/&lt;br /&gt;
&lt;b&gt;@import url(&#39;&lt;/b&gt;custom.css&lt;b&gt;&#39;);&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
med @import url så hämtar man css filer som ligger relativt (styles/custom.se) eller utanför servern (http://adress.css)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://svenskphp.blogspot.com/feeds/1204561057193161779/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://svenskphp.blogspot.com/2012/11/importera-css-filer-i-css.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/1204561057193161779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/1204561057193161779'/><link rel='alternate' type='text/html' href='http://svenskphp.blogspot.com/2012/11/importera-css-filer-i-css.html' title='Importera CSS-filer i CSS'/><author><name>JohannesMattsson</name><uri>http://www.blogger.com/profile/15885527309233775321</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtvwYLqczGjKRZuVnHooye5CM0j_nb-pF5vPHCFs3OMyEamHoYrneix3Mo_NiCSjhmV41MzNwmNbanzHf0MYtAGEr44JBBAnIkj_9QNpbDWwbVNZxv8FrdaitNww19hDY/s220/DSC05037jhvgjhv.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3681402488843432710.post-589277878292869178</id><published>2012-08-09T10:11:00.001+02:00</published><updated>2012-08-15T07:35:38.907+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="google"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="script"/><category scheme="http://www.blogger.com/atom/ns#" term="svenska"/><category scheme="http://www.blogger.com/atom/ns#" term="väder"/><title type='text'>Googles väderplugin</title><content type='html'>&lt;br /&gt;
Kod för googles väderplugin med php + html.&lt;br /&gt;
Endast att kopiera och klistra in.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$placename = &#39;Stockholm&#39;; // ÅÄÖ går att använda&lt;br /&gt;
$place=urlencode($placename);&lt;br /&gt;
$lang= &#39;sv&#39;;&lt;br /&gt;
$place = utf8_encode($place);&lt;br /&gt;
$url = &#39;http://www.google.com/ig/api?weather=&#39;.$place.&#39;&amp;amp;hl=&#39;.$lang.&#39;&#39;;&lt;br /&gt;
$ch = curl_init();&lt;br /&gt;
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);&lt;br /&gt;
curl_setopt ($ch, CURLOPT_URL, $url);&lt;br /&gt;
curl_setopt ($ch, CURLOPT_USERAGENT, $_SERVER[&#39;HTTP_USER_AGENT&#39;]);&lt;br /&gt;
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);&lt;br /&gt;
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0);&lt;br /&gt;
$raw_data = curl_exec ($ch);&lt;br /&gt;
curl_close ($ch);&lt;br /&gt;
&lt;br /&gt;
$xml = simplexml_load_string($raw_data);&lt;br /&gt;
$data = $xml-&amp;gt;weather-&amp;gt;current_conditions;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$temp = $data-&amp;gt;temp_c[&#39;data&#39;];&lt;br /&gt;
&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$img = &#39;http://img0.gmodules.com/&#39; . $data-&amp;gt;icon[&#39;data&#39;];&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$wind = $data-&amp;gt;wind_condition[&#39;data&#39;];&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;div id=&quot;weatherbox&quot; style=&quot;margin-left:30px;&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;div id=&quot;weatherimage&quot; style=&quot;float:left; margin-right:5px;&quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;echo &#39;&amp;lt;img src=&#39;.$img.&#39;&amp;gt;&#39;; ?&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;div id=&quot;weathertemp&quot; style=&quot;float:left;&quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;echo $temp.&#39;&amp;amp;deg;&#39;;?&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;div id=&quot;weatherwind&quot; style=&quot;float:left&quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;echo $wind; ?&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;</content><link rel='replies' type='application/atom+xml' href='http://svenskphp.blogspot.com/feeds/589277878292869178/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://svenskphp.blogspot.com/2012/08/googles-vaderplugin.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/589277878292869178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/589277878292869178'/><link rel='alternate' type='text/html' href='http://svenskphp.blogspot.com/2012/08/googles-vaderplugin.html' title='Googles väderplugin'/><author><name>JohannesMattsson</name><uri>http://www.blogger.com/profile/15885527309233775321</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtvwYLqczGjKRZuVnHooye5CM0j_nb-pF5vPHCFs3OMyEamHoYrneix3Mo_NiCSjhmV41MzNwmNbanzHf0MYtAGEr44JBBAnIkj_9QNpbDWwbVNZxv8FrdaitNww19hDY/s220/DSC05037jhvgjhv.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3681402488843432710.post-5348845183473404957</id><published>2011-12-21T20:38:00.000+01:00</published><updated>2012-07-04T18:37:19.991+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="bygg"/><category scheme="http://www.blogger.com/atom/ns#" term="facebook"/><category scheme="http://www.blogger.com/atom/ns#" term="facebook app"/><category scheme="http://www.blogger.com/atom/ns#" term="facebook logga in"/><category scheme="http://www.blogger.com/atom/ns#" term="facebook php"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>Skapa en inloggningsfunktion till Facebook</title><content type='html'>Skapa en PHP app för Facebook.&lt;br /&gt;
&lt;br /&gt;
Användaren måste gilla sidan och sedan registrera sig på appen för att kunna ta del av all information.&lt;br /&gt;
&lt;br /&gt;
Jag kommer kopiera in denna kod och hoppas att den fungerar, jag har bantat ner den rejält, från att koppla upp sig mot en databas och registrera användare till en lite enklare version. Hoppas den fungerar:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;?php&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;$config = array();&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; $config[&#39;no_session&#39;]=&#39;&#39;;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; $config[&#39;cookie&#39;] = true;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; $config[&#39;appId&#39;] = &#39;&#39;; //App id&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; $config[&#39;secret&#39;] = &#39;&#39;; // App helmlighet&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; $config[&#39;fileUpload&#39;] = false; // Valbart alternativ&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; $facebook = new Facebook($config);&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;$user_id = $facebook-&amp;gt;getUser(); // Hämtar user id för Facebookbesökaren&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;$signed_request = $facebook-&amp;gt;getSignedRequest(); // Bygger en Variabel som heter signed request&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;$like_status = $signed_request[&quot;page&quot;][&quot;liked&quot;]; // Får information ifall sidan är gillad&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;?&amp;gt;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&amp;gt;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&amp;gt;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&amp;gt;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;title&amp;gt;Svenskphp&amp;lt;/title&amp;gt;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;body&quot;&amp;gt;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;div id=&quot;fb-root&quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;script src=&quot;http://connect.facebook.net/en_US/all.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;FB.init({ // Här ansluter jag till Facebooks Javaskript SDK, endast för att kunna ändra storleken på vår &quot;canvas&quot;.&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;appId &amp;nbsp;: &#39;&#39;, //Applikations id&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;status : true,&amp;nbsp;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;cookie : true,&amp;nbsp;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;xfbml &amp;nbsp;: true&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;});&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;FB.Canvas.setSize({ width: 520, height: 1400 }); //sätter storleken på vår canvas till 520pixlar, och 1400px hög&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;?php&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;if ($like_status) //Om man gillar sidan&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;{ &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;nbsp;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;echo &#39;Du gillar sidan!&#39;;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; if($user_id) {&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;//Ifall det finns en user_id (någon som redan är registrerad för vår app)&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; try { &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $user_profile = $facebook-&amp;gt;api(&#39;/me&#39;,&#39;GET&#39;);&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;$name = $user_profile[&#39;name&#39;];&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;$email = $user_profile[&#39;email&#39;];&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;$location = $user_profile[&#39;hometown&#39;];&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; } catch(FacebookApiException $e) {&lt;/span&gt;

&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp;//Ifall användaren har loggat ut, så kan jag ha en user id även fast acces token är invalid&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; //Isåfall så frågar vi användaren att logga in igen&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;//Nedan skapar vi en inloggningslänk som kommer att skapa en inloggningsruta med &quot;permissions&quot;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;$login_url = $facebook-&amp;gt;getLoginUrl( array( &#39;scope&#39; =&amp;gt; &#39;user_about_me, email, publish_stream&#39; ) );&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &#39;&amp;lt;a href=&quot;&#39; . $login_url . &#39;&quot;&amp;gt;Kom tillbaka till appen&amp;lt;/a&amp;gt;&#39;;&lt;/span&gt;

&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; error_log($e-&amp;gt;getType());&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; error_log($e-&amp;gt;getMessage());&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; } &amp;nbsp;&amp;nbsp;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;echo &#39;Text för dig som är registrerad och &quot;inloggad&quot; på appen.&#39;;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;}&amp;nbsp;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;else // Ingen användare, Skriv ut en länk för att registrera sig&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;{&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;echo &#39;Registrera dig till min otroligt fina app &amp;lt;br /&amp;gt;&#39;;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;echo &#39;&amp;lt;a href=&quot;&#39; . $login_url . &#39;&quot;&amp;gt;Registrera dig för appen&amp;lt;/a&amp;gt;&#39;;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;} //Avslutar ifall man gillade sidan&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;
&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;else &amp;nbsp;//Om man inte gillar sidan&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;{&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;echo &#39;Du måste gilla sidan för att kunna vara med på allt skojj :) !!&#39;;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;}&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;?&amp;gt;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;

&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://svenskphp.blogspot.com/feeds/5348845183473404957/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://svenskphp.blogspot.com/2011/12/skapa-en-inloggningsfunktion-till.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/5348845183473404957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/5348845183473404957'/><link rel='alternate' type='text/html' href='http://svenskphp.blogspot.com/2011/12/skapa-en-inloggningsfunktion-till.html' title='Skapa en inloggningsfunktion till Facebook'/><author><name>JohannesMattsson</name><uri>http://www.blogger.com/profile/15885527309233775321</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtvwYLqczGjKRZuVnHooye5CM0j_nb-pF5vPHCFs3OMyEamHoYrneix3Mo_NiCSjhmV41MzNwmNbanzHf0MYtAGEr44JBBAnIkj_9QNpbDWwbVNZxv8FrdaitNww19hDY/s220/DSC05037jhvgjhv.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3681402488843432710.post-4418146174824651129</id><published>2011-11-19T20:08:00.001+01:00</published><updated>2011-11-26T23:16:42.812+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="kod"/><category scheme="http://www.blogger.com/atom/ns#" term="log in script php"/><category scheme="http://www.blogger.com/atom/ns#" term="Logga in script"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql logga in script"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="Php logga in"/><category scheme="http://www.blogger.com/atom/ns#" term="php mysql logga in"/><title type='text'>Skapa en Logga In funktion i PHP</title><content type='html'>Det jag ska presentera i detta inlägg är ett sätt att skapa en &quot;logga in&quot; funktion på en sida!&lt;br /&gt;
&lt;br /&gt;
Det kommer vi göra genom att först skapa en &quot;user&quot; tabell i vår databas, med användarnamn och lösenord, och sen ett PHP script för att hämta och validera data.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Då kör vi igång!&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Mysql&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Gå in i din databas och lägg in följande SQL:&lt;br /&gt;
_______________________________________________________________________&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;--&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;-- Struktur för tabell `user`&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;--&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;CREATE TABLE IF NOT EXISTS `user` (&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; `id` int(11) NOT NULL,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; `username` varchar(255) NOT NULL,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; `password` varchar(255) NOT NULL,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; `email` varchar(255) NOT NULL,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; `level` int(11) NOT NULL,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; `extra` varchar(255) NOT NULL,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp; PRIMARY KEY (`id`)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;) ENGINE=InnoDB DEFAULT CHARSET=latin1;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;--&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;-- Data i tabell `user`&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;--&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;INSERT INTO `user` (`id`, `username`, `password`, `email`, `level`, `extra`) VALUES&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;(0, &#39;admin&#39;, &#39;admin&#39;, &#39;&#39;, 0, &#39;&#39;);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
_______________________________________________________________________&lt;/div&gt;
&lt;div&gt;
Nu har vi skapat ett tabel &quot;user&quot;, som har satt username till admin och lösenord till admin.&lt;br /&gt;
Som du kan se har jag några fler alternativ, men det är inget vi kommer gå igenom i detta avsnitt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Vårt inloggningsformulär&lt;/b&gt;&lt;/span&gt;Nu ska vi skapa ett inloggningsformulär, du kan skapa en login.php fil och skriva in följande mellan body:&lt;br /&gt;
_______________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;lt;div style=&quot;margin-left:auto; margin-right:auto;&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;lt;div id=&quot;login-box&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;lt;H2&amp;gt;Logga in&amp;lt;/H2&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;Logga in till Kundvårdsystemet&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;lt;div id=&quot;login-box-name&quot; style=&quot;margin-top:20px;&quot;&amp;gt;Email:&amp;lt;/div&amp;gt;&amp;lt;div id=&quot;login-box-field&quot; style=&quot;margin-top:20px;&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;lt;form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;process_login.php&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;lt;input name=&quot;myusername&quot; class=&quot;form-login&quot; title=&quot;Username&quot; id=&quot;myusername&quot; size=&quot;30&quot; maxlength=&quot;2048&quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;lt;div id=&quot;login-box-name&quot;&amp;gt;Lösenord:&amp;lt;/div&amp;gt;&amp;lt;div id=&quot;login-box-field&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;lt;input name=&quot;mypassword&quot; type=&quot;password&quot; class=&quot;form-login&quot; title=&quot;Password&quot; id=&quot;mypassword&quot; size=&quot;30&quot; maxlength=&quot;2048&quot; /&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;lt;input type=&quot;submit&quot; /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
_______________________________________________________________________&lt;br /&gt;
&lt;br /&gt;
Så! Nu har vi skapat ett inloggningsformulär, allt som saknas nu är det viktigaste, vår validering.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Validering&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
Skapa en fil med namnet process_login.php - eller det ni vill &lt;br /&gt;
(se då bara till att vårt inloggningsformulär skickar datan till rätt fil)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Skriv in följande:&lt;br /&gt;
_______________________________________________________________________&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;// db värdnamn. &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;$db_host = &quot;localhost&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;//användarnamn för MySQL databas&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;$db_username = &quot;&quot;;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;//Lösenord för MySQL databas&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;$db_pass = &quot;&quot;;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;//namn för MySQL databas&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;$db_name = &quot;&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;//Anslutning&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;$myConnection = mysqli_connect(&quot;$db_host&quot;,&quot;$db_username&quot;,&quot;$db_pass&quot;, &quot;$db_name&quot;) or die (&quot;could not connect to mysql&quot;);&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;ob_start();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;// Användarnamn och lösenord skickat från vårt formulär&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;$myusername=$_POST[&#39;myusername&#39;];&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;$mypassword=$_POST[&#39;mypassword&#39;];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;// För att förhindra Mysql Injection&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;$myusername = stripslashes($myusername);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;$mypassword = stripslashes($mypassword);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;$myusername = mysql_real_escape_string($myusername);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;$mypassword = mysql_real_escape_string($mypassword);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;$query = mysqli_query($myConnection,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&quot;SELECT username,password FROM user WHERE username=&#39;$myusername&#39; and password=&#39;$mypassword&#39;&quot;) or die (mysqli_error($myConnection));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;// Mysql_num_row räknar ROW&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;$count=mysqli_num_rows($query);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;// Om resultatet $myusername och $mypassword finns, så måste det måste vara en rad som hittats&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;if($count==1){&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;// Registrerar $myusername, $mypassword och skickar vidare till index.php, det kan du ändra som du vill&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;session_register(&quot;myusername&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;session_register(&quot;mypassword&quot;);&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;header(&quot;location:index.php&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;else {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;echo &quot;Fel användarnamn eller lösenord&quot;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;ob_end_flush();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: xx-small;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
_______________________________________________________________________&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Spara och testa kör ditt inloggningsformulär!&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://svenskphp.blogspot.com/feeds/4418146174824651129/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://svenskphp.blogspot.com/2011/11/skapa-en-logga-in-funktion-i-php.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/4418146174824651129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/4418146174824651129'/><link rel='alternate' type='text/html' href='http://svenskphp.blogspot.com/2011/11/skapa-en-logga-in-funktion-i-php.html' title='Skapa en Logga In funktion i PHP'/><author><name>JohannesMattsson</name><uri>http://www.blogger.com/profile/15885527309233775321</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtvwYLqczGjKRZuVnHooye5CM0j_nb-pF5vPHCFs3OMyEamHoYrneix3Mo_NiCSjhmV41MzNwmNbanzHf0MYtAGEr44JBBAnIkj_9QNpbDWwbVNZxv8FrdaitNww19hDY/s220/DSC05037jhvgjhv.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3681402488843432710.post-2412171796498956808</id><published>2011-11-07T23:13:00.000+01:00</published><updated>2012-08-13T16:27:52.710+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Installera Wordpress"/><category scheme="http://www.blogger.com/atom/ns#" term="svenska"/><category scheme="http://www.blogger.com/atom/ns#" term="Wordpress"/><category scheme="http://www.blogger.com/atom/ns#" term="Wordpress guide"/><category scheme="http://www.blogger.com/atom/ns#" term="Wordpress lathund"/><category scheme="http://www.blogger.com/atom/ns#" term="Wordpress på svenska"/><title type='text'>Installera Wordpress</title><content type='html'>Detta hör knappast till PHP programmering, men eftersom Wordpress har blivit så populärt har jag fixat ihop en liten guide om hur man gör för att installera Wordpress&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-3839273299318253&quot;;
/* Blogger-header */
google_ad_slot = &quot;4723151640&quot;;
google_ad_width = 250;
google_ad_height = 250;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 18.0pt; line-height: 115%;&quot;&gt;Installera Wordpress.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;I detta
avsnitt ska vi installera WP(Wordpress).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: 14.0pt; line-height: 115%;&quot;&gt;Hämta installationen&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;Det första
steget är att ladda ner alla filer som behövs för att kunna installera WP.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;Filerna
hämtar man på &lt;/span&gt;&lt;a href=&quot;http://sv.wordpress.org/&quot;&gt;&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;http://sv.wordpress.org&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt; &lt;br /&gt;
&lt;/span&gt;&lt;i&gt;eller &lt;/i&gt;&lt;a href=&quot;http://wordpress.org/&quot;&gt;&lt;i&gt;http://wordpress.org&lt;/i&gt;&lt;/a&gt;&lt;i&gt; för den engelska versionen.&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;Tryck på ”&lt;b&gt;ladda ner Wordpress&lt;/b&gt;” &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;Spara sedan
filen på datorn.&lt;br /&gt;
&lt;br /&gt;
Filen du laddat ner är zippad.&lt;br /&gt;
Så det vi behöver göra är att ”zippa” upp den, det kan vi göra genom att öppna filen
vi laddat ner och kopiera mappen ”wordpress”, klistra sedan in på förslagsvis
skrivbordet.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;Nu har du
hämtat installationsfilerna! &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: 14.0pt; line-height: 115%;&quot;&gt;Ladda upp installationen&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;Nu ska vi
ladda upp installationen till vår server, för att sedan kunna påbörja vår
installation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;
När vi ska ansluta till servern&lt;a href=&quot;file:///C:/Users/Johannes/Desktop/Avans/Installation.docx#_ftn2&quot; name=&quot;_ftnref2&quot; title=&quot;&quot;&gt;&lt;span class=&quot;MsoFootnoteReference&quot;&gt;&lt;span class=&quot;MsoFootnoteReference&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12.0pt; line-height: 115%; mso-ansi-language: SV; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;[2]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;
kan vi öppna upp en mapp, och skriva in den information vi fått av
webbhotellet.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;Adressen skriver vi in uppe i sökvägen för mappen.&lt;br /&gt;ftp://dinsida.se&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Skriv sedan in dina&amp;nbsp;inloggningsuppgifter för FTP&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;Öppna nu din
wordpress mapp som vi förslagsvis lade på skrivbordet.&lt;br /&gt;
Kopiera alla filer. Klistra sedan in i din mapp på servern.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;När du tryck
”Klistra in” kommer ingenting att hända, vilket är helt i sin ordning.&lt;br /&gt;
Windows har nämligen inget timglas som laddar när man för över filer via FTP&lt;a href=&quot;file:///C:/Users/Johannes/Desktop/Avans/Installation.docx#_ftn3&quot; name=&quot;_ftnref3&quot; title=&quot;&quot;&gt;&lt;span class=&quot;MsoFootnoteReference&quot;&gt;&lt;span class=&quot;MsoFootnoteReference&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12.0pt; line-height: 115%; mso-ansi-language: SV; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;[3]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;(Ungefärlig överföringstid: 5-12 minuter beroende på vad du har för hastighet på bredbandet)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;För att kontrollera
ifall vår överföring har gått bra kan vi öppna en webbläsare (helst Firefox)&lt;br /&gt;
och navigera till &lt;/span&gt;&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;a href=&quot;http://utbildning.avans.se/ht2011/&quot;&gt;http://d&lt;/a&gt;insida&lt;/span&gt;&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;” &lt;br /&gt;&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;Ifall
överföringen är klar borde det komma upp en text där det står att du ska skapa
en konfigurations fil.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: 14.0pt; line-height: 115%;&quot;&gt;Installera Wordpress&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;Tryck på
”skapa en konfigurationsfil”&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;Du får nu
upp en sida där det står vad du behöver för att installera WP på din server.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 13.5pt; margin-left: 36.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: Arial; mso-fareast-language: SV;&quot;&gt;1.&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;Databasnamn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 13.5pt; margin-left: 36.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: Arial; mso-fareast-language: SV;&quot;&gt;2.&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;Användarnamn för
databasen&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 13.5pt; margin-left: 36.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: Arial; mso-fareast-language: SV;&quot;&gt;3.&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;Lösenord för databasen&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 13.5pt; margin-left: 36.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: Arial; mso-fareast-language: SV;&quot;&gt;4.&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;Serveradress för
databasen&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 13.5pt; margin-left: 36.0pt; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt; text-indent: -18.0pt;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: Arial; mso-fareast-language: SV;&quot;&gt;5.&lt;span style=&quot;font: 7.0pt &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;Tabellprefix (om du
vill köra flera installationer av WordPress i samma databas)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;Alla dessa
uppgifter har Webbhotellet.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;Tryck på
knappen ”Då kör vi!”&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 13.5pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 13.5pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-size: 12pt;&quot;&gt;Nu får du upp ett
antal textfält som ska fyllas i. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background: white; line-height: 13.5pt; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;Nedan behöver du ange dina databasuppgifter. Om du är
osäker på vilka dessa är, kontakta ditt webbhotell.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-collapse: collapse; width: 700px;&quot;&gt;
 &lt;tbody&gt;
&lt;tr&gt;
  &lt;td style=&quot;background: #F3F3F3; border-bottom: solid white 6.0pt; border: none; padding: 12.0pt 7.5pt 7.5pt 7.5pt; width: 97.5pt;&quot; valign=&quot;top&quot; width=&quot;130&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 12pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;Databasnamn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background: #F3F3F3; border-bottom: solid white 6.0pt; border: none; padding: 7.5pt 7.5pt 7.5pt 7.5pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 6.75pt; margin-left: 0cm; margin-right: 0cm; margin-top: 12pt;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;&lt;input name=&quot;dbname&quot; size=&quot;25&quot; type=&quot;text&quot; value=&quot;utbildning_avans_se&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background: #F3F3F3; border-bottom: solid white 6.0pt; border: none; padding: 7.5pt 7.5pt 7.5pt 7.5pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 6.75pt; margin-left: 0cm; margin-right: 0cm; margin-top: 12pt;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;Namnet på databasen du vill använda
  för WordPress.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;background: #F3F3F3; border-bottom: solid white 6.0pt; border: none; padding: 12.0pt 7.5pt 7.5pt 7.5pt; width: 97.5pt;&quot; valign=&quot;top&quot; width=&quot;130&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 12pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;Databasavändare&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background: #F3F3F3; border-bottom: solid white 6.0pt; border: none; padding: 7.5pt 7.5pt 7.5pt 7.5pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 6.75pt; margin-left: 0cm; margin-right: 0cm; margin-top: 12pt;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;&lt;input name=&quot;uname&quot; size=&quot;25&quot; type=&quot;text&quot; value=&quot;utbildning_avans_se&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background: #F3F3F3; border-bottom: solid white 6.0pt; border: none; padding: 7.5pt 7.5pt 7.5pt 7.5pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 6.75pt; margin-left: 0cm; margin-right: 0cm; margin-top: 12pt;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;Databasanvändaren för MySQL.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;background: #F3F3F3; border-bottom: solid white 6.0pt; border: none; padding: 12.0pt 7.5pt 7.5pt 7.5pt; width: 97.5pt;&quot; valign=&quot;top&quot; width=&quot;130&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 12pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;Lösenord&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background: #F3F3F3; border-bottom: solid white 6.0pt; border: none; padding: 7.5pt 7.5pt 7.5pt 7.5pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 6.75pt; margin-left: 0cm; margin-right: 0cm; margin-top: 12pt;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;&lt;input name=&quot;pwd&quot; size=&quot;25&quot; type=&quot;text&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background: #F3F3F3; border-bottom: solid white 6.0pt; border: none; padding: 7.5pt 7.5pt 7.5pt 7.5pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 6.75pt; margin-left: 0cm; margin-right: 0cm; margin-top: 12pt;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;...och MySQL-lösenord.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;background: #F3F3F3; border-bottom: solid white 6.0pt; border: none; padding: 12.0pt 7.5pt 7.5pt 7.5pt; width: 97.5pt;&quot; valign=&quot;top&quot; width=&quot;130&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 12pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;Databasserver (host)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background: #F3F3F3; border-bottom: solid white 6.0pt; border: none; padding: 7.5pt 7.5pt 7.5pt 7.5pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 6.75pt; margin-left: 0cm; margin-right: 0cm; margin-top: 12pt;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;&lt;input name=&quot;dbhost&quot; size=&quot;25&quot; type=&quot;text&quot; value=&quot;sql2.jamtport.se&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background: #F3F3F3; border-bottom: solid white 6.0pt; border: none; padding: 7.5pt 7.5pt 7.5pt 7.5pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 6.75pt; margin-left: 0cm; margin-right: 0cm; margin-top: 12pt;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;Du bör kunna få denna information från
  ditt webbhotell, om inte&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Courier New&amp;quot;; font-size: 13.5pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;localhost&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;&amp;nbsp;fungerar.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr&gt;
  &lt;td style=&quot;background: #F3F3F3; border-bottom: solid white 6.0pt; border: none; padding: 12.0pt 7.5pt 7.5pt 7.5pt; width: 97.5pt;&quot; valign=&quot;top&quot; width=&quot;130&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; margin-left: 0cm; margin-right: 0cm; margin-top: 12pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;Tabellprefix&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background: #F3F3F3; border-bottom: solid white 6.0pt; border: none; padding: 7.5pt 7.5pt 7.5pt 7.5pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 6.75pt; margin-left: 0cm; margin-right: 0cm; margin-top: 12pt;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;&lt;input name=&quot;prefix&quot; size=&quot;25&quot; type=&quot;text&quot; value=&quot;wp_(unikt dittnamn)&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
  &lt;td style=&quot;background: #F3F3F3; border-bottom: solid white 6.0pt; border: none; padding: 7.5pt 7.5pt 7.5pt 7.5pt;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 6.75pt; margin-left: 0cm; margin-right: 0cm; margin-top: 12pt;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: SV;&quot;&gt;Om du vill köra flera installationer
  av WordPress i samma databas, ändra detta.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;Fyll i
uppgifterna och tryck ”Vidare”&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;Ifall du
fyllt i rätt uppgifter kommer det upp:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 9.0pt;&quot;&gt;OK! Du har klarat av
installationen så här långt. WordPress kan nu kommunicera med din databas. Om
du är redo så är det dags att…&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;Tryck på
”Starta installationen”&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&amp;nbsp;Resten klurar du nog ut själv&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br clear=&quot;all&quot; /&gt;
&lt;hr align=&quot;left&quot; size=&quot;1&quot; width=&quot;33%&quot; /&gt;
&lt;div id=&quot;ftn1&quot;&gt;
&lt;div class=&quot;MsoFootnoteText&quot;&gt;
&lt;a href=&quot;file:///C:/Users/Johannes/Desktop/Avans/Installation.docx#_ftnref1&quot; name=&quot;_ftn1&quot; title=&quot;&quot;&gt;&lt;span class=&quot;MsoFootnoteReference&quot;&gt;&lt;span class=&quot;MsoFootnoteReference&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; line-height: 115%; mso-ansi-language: SV; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;[1]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; En fil
som är komprimerad för att ta mindre plats&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;ftn2&quot;&gt;
&lt;div class=&quot;MsoFootnoteText&quot;&gt;
&lt;a href=&quot;file:///C:/Users/Johannes/Desktop/Avans/Installation.docx#_ftnref2&quot; name=&quot;_ftn2&quot; title=&quot;&quot;&gt;&lt;span class=&quot;MsoFootnoteReference&quot;&gt;&lt;span class=&quot;MsoFootnoteReference&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; line-height: 115%; mso-ansi-language: SV; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;[2]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; Server –
Platsen där vår sida ligger&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;ftn3&quot;&gt;
&lt;div class=&quot;MsoFootnoteText&quot;&gt;
&lt;a href=&quot;file:///C:/Users/Johannes/Desktop/Avans/Installation.docx#_ftnref3&quot; name=&quot;_ftn3&quot; title=&quot;&quot;&gt;&lt;span class=&quot;MsoFootnoteReference&quot;&gt;&lt;span class=&quot;MsoFootnoteReference&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; line-height: 115%; mso-ansi-language: SV; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;[3]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; FTP –
File Transfer Protocol, används för att föra över filer via Internet.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoFootnoteText&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://svenskphp.blogspot.com/feeds/2412171796498956808/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://svenskphp.blogspot.com/2011/11/installera-wordpress.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/2412171796498956808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/2412171796498956808'/><link rel='alternate' type='text/html' href='http://svenskphp.blogspot.com/2011/11/installera-wordpress.html' title='Installera Wordpress'/><author><name>JohannesMattsson</name><uri>http://www.blogger.com/profile/15885527309233775321</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtvwYLqczGjKRZuVnHooye5CM0j_nb-pF5vPHCFs3OMyEamHoYrneix3Mo_NiCSjhmV41MzNwmNbanzHf0MYtAGEr44JBBAnIkj_9QNpbDWwbVNZxv8FrdaitNww19hDY/s220/DSC05037jhvgjhv.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3681402488843432710.post-2598055858117631574</id><published>2011-10-13T17:35:00.001+02:00</published><updated>2011-10-19T18:26:06.684+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="blob databas"/><category scheme="http://www.blogger.com/atom/ns#" term="ladda upp bilder i php"/><category scheme="http://www.blogger.com/atom/ns#" term="Php bilder"/><category scheme="http://www.blogger.com/atom/ns#" term="phpmyadmin"/><category scheme="http://www.blogger.com/atom/ns#" term="svenska"/><title type='text'>Lagra bilder i Mysql (skapa dynamiskt galleri)</title><content type='html'>&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: large;&quot;&gt;&lt;b&gt;Lagra bilder i Mysql (skapa dynamiskt galleri)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;I detta inlägg kommer jag gå igenom hur man laddar upp bilder till din databas och sedan hanterar (lägger till tar bort) dem. Ursprungliga har jag hittat på nätet.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;/*Uppdaterad,&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;fixat sql fråga. tack till peetra&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;*/&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Det vi ska börja med är att skapa tabellen i vår databas.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;CREATE TABLE `img_gallery` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(64) character SET utf8 NOT NULL, `ext` varchar(8) character SET utf8 NOT NULL, `image_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `data` mediumblob NOT NULL, PRIMARY KEY (`id`) );&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Nästa steg är att skapa en Phpfil, namge den till &quot;image.php&quot; eller något passande, jag har lagt all kod i samma fil.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;$db_host = &quot;&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;//Användarnamn för vår MySQL databas&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;$db_username = &quot;&quot;;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;//Lösenord för vår MySQL databas&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;$db_pass = &quot;&quot;;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;//namn för vår MySQL databas&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;$db_name = &quot;&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;$table = &#39;img_gallery&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;//&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;if (!mysql_connect($db_host, $db_username, $db_pass))&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; die(&quot;Can&#39;t connect to database&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;if (!mysql_select_db($db_name))&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; die(&quot;Can&#39;t select database&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;function sql_safe($s)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; if (get_magic_quotes_gpc())&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $s = stripslashes($s);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; return mysql_real_escape_string($s);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;//___________________________________________________________________________________________________________________________&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;if ($_SERVER[&#39;REQUEST_METHOD&#39;] == &#39;POST&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; $title = trim(sql_safe($_POST[&#39;title&#39;]));&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;$text = trim(sql_safe($_POST[&#39;text&#39;]));&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; if ($title == &#39;&#39;) // om titeln inte är satt&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $title = &#39;Okänd titel&#39;;// Så använder vi detta som titel&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (isset($_FILES[&#39;photo&#39;]))&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @list(, , $imtype, ) = getimagesize($_FILES[&#39;photo&#39;][&#39;tmp_name&#39;]);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if ($imtype == 3) // Kollar bildtyp&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $ext=&quot;png&quot;; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; elseif ($imtype == 2)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $ext=&quot;jpeg&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; elseif ($imtype == 1)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $ext=&quot;gif&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $msg = &#39;Error: unknown file format&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!isset($msg)){&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $data = file_get_contents($_FILES[&#39;photo&#39;][&#39;tmp_name&#39;]);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $data = mysql_real_escape_string($data);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mysql_query(&quot;INSERT INTO {$table}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SET ext=&#39;$ext&#39;, title=&#39;$title&#39;,&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data=&#39;$data&#39;, text=&#39;$text&#39;&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $msg = &#39;Filen laddades upp!&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; elseif (isset($_GET[&#39;title&#39;]))&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $msg = &#39;Error: filen laddades inte upp&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;//___________________________________________________________________________________________________________________________&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(!empty($_REQUEST[&#39;Delete&#39;])){ &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $id = intval($_POST[&#39;opt&#39;]);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mysql_query(&quot;DELETE FROM {$table} WHERE id=$id&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $msg = &#39;Bild Raderad&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;$notemsg = &#39;Ladda upp bild&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;//___________________________________________________________________________________________________________________________&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; if(!empty($_REQUEST[&#39;Change&#39;])){ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $id = intval($_POST[&#39;opt&#39;]);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $result = mysql_query(&quot;SELECT id, title, data, text FROM {$table} WHERE id=$id&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; list($id, $imgtitle, $imgdata, $imgtext) = mysql_fetch_row($result);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;$notemsg = &#39;Ändra bilddata&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;$savebutton = &#39;&amp;lt;label for=&quot;photo&quot;&amp;gt;Foto:&amp;lt;/label&amp;gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;input type=&quot;file&quot; name=&quot;updatephoto&quot; id=&quot;updatephoto&quot;&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt; &amp;lt;input type=&quot;submit&quot; name=&quot;Save&quot; value=&quot;Spara&quot;&amp;gt;&#39;;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;//___________________________________________________________________________________________________________________________&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;if(!empty($_REQUEST[&#39;Save&#39;])){&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; if (isset($_FILES[&#39;updatephoto&#39;])){&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @list(, , $imtype, ) = getimagesize($_FILES[&#39;updatephoto&#39;][&#39;tmp_name&#39;]);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if ($imtype == 3)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $ext=&quot;png&quot;; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; elseif ($imtype == 2)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $ext=&quot;jpeg&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; elseif ($imtype == 1)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $ext=&quot;gif&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $errormsg = &#39;Error: Okänt filformat&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (!isset($errormsg)){&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $data = file_get_contents($_FILES[&#39;updatephoto&#39;][&#39;tmp_name&#39;]);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $data = mysql_real_escape_string($data);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $id = intval($_POST[&#39;opt&#39;]);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;mysql_query(&quot;UPDATE {$table} SET ext=&#39;$ext&#39;, title=&#39;$_POST[title]&#39;, data=&#39;$data&#39;, text=&#39;$_POST[text]&#39; WHERE id=&#39;$id&#39;&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;$msg = &#39;Sparat&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;//___________________________________________________________________________________________________________________________&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;elseif (isset($_GET[&#39;show&#39;])){&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; $id = intval($_GET[&#39;show&#39;]);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; $result = mysql_query(&quot;SELECT ext, UNIX_TIMESTAMP(image_time), data&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FROM {$table}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; WHERE id=$id LIMIT 1&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; if (mysql_num_rows($result) == 0)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; die(&#39;no image&#39;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; list($ext, $image_time, $data) = mysql_fetch_row($result);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; $send_304 = false;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; if (php_sapi_name() == &#39;apache&#39;){&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $ar = apache_request_headers();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (isset($ar[&#39;If-Modified-Since&#39;]) &amp;amp;&amp;amp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ($ar[&#39;If-Modified-Since&#39;] != &#39;&#39;) &amp;amp;&amp;amp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; (strtotime($ar[&#39;If-Modified-Since&#39;]) &amp;gt;= $image_time))&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $send_304 = true; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; if ($send_304){&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; header(&#39;Last-Modified: &#39;.gmdate(&#39;D, d M Y H:i:s&#39;, $ts).&#39; GMT&#39;, true, 304);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; exit();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; header(&#39;Last-Modified: &#39;.gmdate(&#39;D, d M Y H:i:s&#39;, $image_time).&#39; GMT&#39;,&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; true, 200);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; header(&#39;Expires: &#39;.gmdate(&#39;D, d M Y H:i:s&#39;, &amp;nbsp;$image_time + 86400*365).&#39; GMT&#39;,&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; true, 200);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; header(&#39;Content-Length: &#39;.strlen($data));&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; header(&quot;Content-type: image/{$ext}&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; echo $data;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; exit();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;title&amp;gt;Bildgalleri&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;if (isset($msg)) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;p style=&quot;font-weight: bold;&quot;&amp;gt;&amp;lt;?=$msg?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;a href=&quot;&amp;lt;?=$PHP_SELF?&amp;gt;&quot;&amp;gt;Ladda om sida&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;h2&amp;gt;Uppladdade bilder:&amp;lt;/h2&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;form action=&quot;&amp;lt;?=$PHP_SELF?&amp;gt;&quot; method=&quot;post&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;$result = mysql_query(&quot;SELECT id, image_time, title FROM {$table} ORDER BY id DESC&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;if (mysql_num_rows($result) == 0) // om tabellen är tom&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; echo &#39;&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Inga bilder hämtades..&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; echo &#39;&amp;lt;ul&amp;gt;&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; while(list($id, $image_time, $title) = mysql_fetch_row($result))&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Skriver ut&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &quot;&amp;lt;li&amp;gt;&amp;lt;input type=&#39;radio&#39; name=&#39;opt&#39; value=&#39;{$id}&#39;&amp;gt;&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &quot;&amp;lt;a href=&#39;{$PHP_SELF}?show={$id}&#39;&amp;gt;{$title}&amp;lt;/a&amp;gt; &amp;amp;ndash; &quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &quot;&amp;lt;small&amp;gt;{$image_time}&amp;lt;/small&amp;gt;&amp;lt;/li&amp;gt;&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; echo &#39;&amp;lt;/ul&amp;gt;&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; echo &#39;&amp;lt;input type=&quot;submit&quot; name=&quot;Delete&quot; value=&quot;Radera Vald&quot;&amp;gt;&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp;echo &#39;&amp;lt;input type=&quot;submit&quot; name=&quot;Change&quot; value=&quot;Ändra Vald&quot;&amp;gt;&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;h2&amp;gt;&amp;lt;?php echo $notemsg; ?&amp;gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;form action=&quot;&amp;lt;?=$PHP_SELF?&amp;gt;&quot; method=&quot;POST&quot; enctype=&quot;multipart/form-data&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;label for=&quot;title&quot;&amp;gt;Titel:&amp;lt;/label&amp;gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;input type=&quot;text&quot; name=&quot;title&quot; id=&quot;title&quot; value=&quot;&amp;lt;?php echo $imgtitle;?&amp;gt;&quot; size=&quot;30&quot;&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;label for=&quot;text&quot;&amp;gt;Bildtext:&amp;lt;/label&amp;gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;textarea name=&quot;text&quot; rows=&quot;10&quot; cols=&quot;30&quot;&amp;gt;&amp;lt;?php echo $imgtext;?&amp;gt;&amp;lt;/textarea&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;?php echo &quot;&amp;lt;input type=&#39;hidden&#39; name=&#39;opt&#39; value=&quot;.$_POST[&#39;opt&#39;].&quot;&amp;gt;&quot;; ?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;?php&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; if(empty($_REQUEST[&#39;Change&#39;]))&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;echo &#39;&amp;lt;label for=&quot;photo&quot;&amp;gt;Foto:&amp;lt;/label&amp;gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;input type=&quot;file&quot; name=&quot;photo&quot; id=&quot;photo&quot;&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;input type=&quot;submit&quot; value=&quot;Ladda upp&quot;&amp;gt;&#39;;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;echo $savebutton;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Starta och kör.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Det kan kännas som väldigt mycket kod, och lite förklaring, men tanken är att du själv ska anpassa den efter hur du vill ha den. Och att jag slipper skriva så mycket ;)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Har du problem så kommentera gärna nedan, så hjälper jag till.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://svenskphp.blogspot.com/feeds/2598055858117631574/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://svenskphp.blogspot.com/2011/10/lagra-bilder-i-mysql-skapa-dynamiskt.html#comment-form' title='1 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/2598055858117631574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/2598055858117631574'/><link rel='alternate' type='text/html' href='http://svenskphp.blogspot.com/2011/10/lagra-bilder-i-mysql-skapa-dynamiskt.html' title='Lagra bilder i Mysql (skapa dynamiskt galleri)'/><author><name>JohannesMattsson</name><uri>http://www.blogger.com/profile/15885527309233775321</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtvwYLqczGjKRZuVnHooye5CM0j_nb-pF5vPHCFs3OMyEamHoYrneix3Mo_NiCSjhmV41MzNwmNbanzHf0MYtAGEr44JBBAnIkj_9QNpbDWwbVNZxv8FrdaitNww19hDY/s220/DSC05037jhvgjhv.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3681402488843432710.post-7201910400313165036</id><published>2011-10-12T11:28:00.000+02:00</published><updated>2011-10-12T22:14:41.618+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="lär dig php"/><category scheme="http://www.blogger.com/atom/ns#" term="Mail"/><category scheme="http://www.blogger.com/atom/ns#" term="mail script php"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>Php - mailserver</title><content type='html'>&lt;b&gt;I detta inlägg kommer jag gå igenom hur man skapar ett enkelt mailsystem.&lt;/b&gt;&lt;br /&gt;
&lt;i&gt;Koden hittade jag för länge sen när jag var ute och fiskade på nätet, jag har även en version där jag skickar med en bild i mailet.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Du kommer kunna fylla i ett bokningsformulär med information, som sedan skickas till din mail-adress.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Steg1&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot;&gt;Skapa en ny php-fil med namnet &quot;boka_form&quot;&lt;/span&gt;&lt;br /&gt;
Kopiera och klistra in följande mellan &amp;lt;body&amp;gt; och &amp;lt;/body&amp;gt;:&lt;br /&gt;
&lt;br /&gt;

&lt;span style=&quot;float:left&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-3839273299318253&quot;;
/* Blogger-header */
google_ad_slot = &quot;4723151640&quot;;
google_ad_width = 250;
google_ad_height = 250;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;/span&gt;

&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; width=&quot;520px&quot;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;tr&amp;gt;&amp;lt;td style=&quot;height:10px&quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;tr&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td colspan=&quot;2&quot; style=&quot;text-align:justify; line-height:15px;&quot; class=&quot;body&quot;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;form name=&quot;frm&quot; method=&quot;POST&quot; action=&quot;send_mail.php&quot; enctype=&quot;multipart/form-data&quot;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td width=&quot;23%&quot; class=&quot;body&quot;&amp;gt; Namn&amp;lt;/td&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td width=&quot;3%&quot; class=&quot;body&quot;&amp;gt;:&amp;lt;/td&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td width=&quot;74%&quot;&amp;gt;&amp;lt;input type=&quot;text&quot; name=&quot;strname&quot; class=&quot;textfield&quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/tr&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr&amp;gt;&amp;lt;td style=&quot;height:3px&quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td width=&quot;23%&quot; class=&quot;body&quot;&amp;gt; Kontakt nr.&amp;lt;/td&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td width=&quot;3%&quot; class=&quot;body&quot;&amp;gt;:&amp;lt;/td&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td width=&quot;74%&quot;&amp;gt;&amp;lt;input type=&quot;text&quot; name=&quot;strno&quot; class=&quot;textfield&quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/tr&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr&amp;gt;&amp;lt;td style=&quot;height:3px&quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td width=&quot;23%&quot; class=&quot;body&quot;&amp;gt; Email&amp;lt;/td&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td width=&quot;3%&quot; class=&quot;body&quot;&amp;gt;:&amp;lt;/td&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td width=&quot;74%&quot;&amp;gt;&amp;lt;input type=&quot;text&quot; name=&quot;stremail&quot; class=&quot;textfield&quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/tr&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr&amp;gt;&amp;lt;td style=&quot;height:3px&quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td width=&quot;23%&quot; class=&quot;body&quot;&amp;gt; Kommentar&amp;lt;br /&amp;gt; (max 125 tecken)&amp;lt;/td&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td width=&quot;3%&quot; class=&quot;body&quot;&amp;gt;:&amp;lt;/td&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td width=&quot;74%&quot;&amp;gt;&amp;lt;textarea cols=&quot;26&quot; maxlength=&quot;125&quot; name=&quot;strcomments&quot;&amp;gt;&amp;lt;/textarea&amp;gt;&amp;lt;/td&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/tr&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr&amp;gt;&amp;lt;td style=&quot;height:3px&quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td colspan=&quot;3&quot; align=&quot;center&quot;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;input type=&quot;submit&quot; value=&quot;Skicka&quot; name=&quot;submit&quot; &amp;lt;input type=&quot;reset&quot; value=&quot;Rensa&quot; name=&quot;reset&quot;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/td&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/tr&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/form&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/table&amp;gt; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-3839273299318253&quot;;
/* Svenskphp bloggcontent */
google_ad_slot = &quot;6983582309&quot;;
google_ad_width = 336;
google_ad_height = 280;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Steg2&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Skapa en ny php-fil med namnet &quot;send_mail&quot;&lt;br /&gt;
Kopiera och klistra in följande:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;lt;?php &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$strname=ucfirst($_REQUEST[&quot;strname&quot;]);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$phone=$_REQUEST[&quot;strno&quot;];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if($phone != &quot;&quot;){ $strno=$phone; } else { $strno=&quot;-&quot;; } &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; $stremail=$_REQUEST[&quot;stremail&quot;]; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; $strcomments=ucfirst($_REQUEST[&quot;strcomments&quot;]);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; $strresume_name=$_FILES[&quot;strresume&quot;][&quot;name&quot;];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; $strresume_type=$_FILES[&quot;strresume&quot;][&quot;type&quot;];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; $strresume_size=$_FILES[&quot;strresume&quot;][&quot;size&quot;];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; $strresume_temp=$_FILES[&quot;strresume&quot;][&quot;tmp_name&quot;];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; if (isset($strname) &amp;amp;&amp;amp; isset($stremail) &amp;amp;&amp;amp; isset($strcomments))&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $message= &#39;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;table cellspacing=&quot;0&quot; cellpadding=&quot;8&quot; border=&quot;0&quot; width=&quot;400&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td colspan=&quot;2&quot;&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr bgcolor=&quot;#eeeeee&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td style=&quot;font-family:Verdana, Arial; font-size:11px; color:#333333;&quot;&amp;gt;&amp;lt;strong&amp;gt;Namn&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td style=&quot;font-family:Verdana, Arial; font-size:11px; color:#333333;&quot;&amp;gt;&#39;.$strname.&#39;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr&amp;gt;&amp;lt;td colspan=&quot;2&quot; style=&quot;padding:0px;&quot;&amp;gt;&amp;lt;img src=&quot;images/whitespace.gif&quot; alt=&quot;&quot; width=&quot;100%&quot; height=&quot;1&quot; /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr bgcolor=&quot;#eeeeee&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td style=&quot;font-family:Verdana, Arial; font-size:11px; color:#333333;&quot;&amp;gt;&amp;lt;strong&amp;gt;Kontakt nr.&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td style=&quot;font-family:Verdana, Arial; font-size:11px; color:#333333;&quot;&amp;gt;&#39;.$strno.&#39;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr&amp;gt;&amp;lt;td colspan=&quot;2&quot; style=&quot;padding:0px;&quot;&amp;gt;&amp;lt;img src=&quot;images/whitespace.gif&quot; alt=&quot;&quot; width=&quot;100%&quot; height=&quot;1&quot; /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr bgcolor=&quot;#eeeeee&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td style=&quot;font-family:Verdana, Arial; font-size:11px; color:#333333;&quot;&amp;gt;&amp;lt;strong&amp;gt;Email&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td style=&quot;font-family:Verdana, Arial; font-size:11px; color:#333333;&quot;&amp;gt;&#39;.$stremail.&#39;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr&amp;gt;&amp;lt;td colspan=&quot;2&quot; style=&quot;padding:0px;&quot;&amp;gt;&amp;lt;img src=&quot;images/whitespace.gif&quot; alt=&quot;&quot; width=&quot;100%&quot; height=&quot;1&quot; /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr bgcolor=&quot;#eeeeee&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td colspan=&quot;2&quot; style=&quot;font-family:Verdana, Arial; font-size:11px; color:#333333;&quot;&amp;gt;&amp;lt;strong&amp;gt;Kommentar&amp;lt;/strong&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/tr&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr bgcolor=&quot;#eeeeee&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;td colspan=&quot;2&quot; style=&quot;font-family:Verdana, Arial; font-size:11px; color:#333333;&quot;&amp;gt;&#39;.$strcomments.&#39;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/tr&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;tr&amp;gt;&amp;lt;td colspan=&quot;2&quot; style=&quot;padding:0px;&quot;&amp;gt;&amp;lt;img src=&quot;images/whitespace.gif&quot; alt=&quot;&quot; width=&quot;100%&quot; height=&quot;1&quot; /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/table&amp;gt;&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; $subject = &quot;Nytt mail från svenskphp.blogspot.com&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; // Till emailadress:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; $to=&quot;din@emailadress.se&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; // Email header med attachment&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; $fp = fopen($strresume_temp, &quot;rb&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; $file = fread($fp, $strresume_size);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; $file = chunk_split(base64_encode($file));&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; $num = md5(time());&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Normala headers&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$headers &amp;nbsp;= &quot;From: &quot;.$strname.&quot;&amp;lt;&quot;.$stremail.&quot;&amp;gt;\r\n&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$headers &amp;nbsp;.= &quot;MIME-Version: 1.0\r\n&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$headers &amp;nbsp;.= &quot;Content-Type: multipart/mixed; &quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$headers &amp;nbsp;.= &quot;boundary=&quot;.$num.&quot;\r\n&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$headers &amp;nbsp;.= &quot;--$num\r\n&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Hjälper till att ta bort spamm &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; $headers .= &quot;Message-ID: &amp;lt;&quot;.gettimeofday().&quot; TheSystem@&quot;.$_SERVER[&#39;SERVER_NAME&#39;].&quot;&amp;gt;\r\n&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; $headers .= &quot;X-Mailer: PHP v&quot;.phpversion().&quot;\r\n&quot;; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Med meddelande&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; $headers .= &quot;Content-Type: text/html; charset=iso-8859-1\r\n&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$headers .= &quot;Content-Transfer-Encoding: 8bit\r\n&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$headers .= &quot;&quot;.$message.&quot;\n&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$headers .= &quot;--&quot;.$num.&quot;\n&quot;;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Ifall du har en &quot;attachment&quot;, tex bild osv&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; $headers &amp;nbsp;.= &quot;Content-Type:&quot;.$strresume_type.&quot; &quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$headers &amp;nbsp;.= &quot;name=\&quot;&quot;.$strresume_name.&quot;\&quot;r\n&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$headers &amp;nbsp;.= &quot;Content-Transfer-Encoding: base64\r\n&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$headers &amp;nbsp;.= &quot;Content-Disposition: attachment; &quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$headers &amp;nbsp;.= &quot;filename=\&quot;&quot;.$strresume_name.&quot;\&quot;\r\n\n&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$headers &amp;nbsp;.= &quot;&quot;.$file.&quot;\r\n&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$headers &amp;nbsp;.= &quot;--&quot;.$num.&quot;--&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; // Skicka mail&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;@mail($to, $subject, $message, $headers);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;fclose($fp);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; echo &#39;&amp;lt;font style=&quot;font-family:Verdana, Arial; font-size:11px; color:#333333; font-weight:bold&quot;&amp;gt;Din information skickades.&amp;lt;br /&amp;gt;&amp;lt;/font&amp;gt;&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;echo &#39;&amp;lt;font style=&quot;font-family:Verdana, Arial; font-size:11px; color:#F3363F; font-weight:bold&quot;&amp;gt;Filen skickades inte, kontrollera att du fyllt i alla fält.&amp;lt;/font&amp;gt;&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;?&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Du enkelt ändra utseendet för ditt meddelande i variabeln $message&lt;br /&gt;
Ifall du har problem med åä och ö har du förmodligen problem med din charset, testa då att lägga in&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: xx-small;&quot;&gt;&amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
Längst upp i dokumentet och testa igen.</content><link rel='replies' type='application/atom+xml' href='http://svenskphp.blogspot.com/feeds/7201910400313165036/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://svenskphp.blogspot.com/2011/10/php-mailserver.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/7201910400313165036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/7201910400313165036'/><link rel='alternate' type='text/html' href='http://svenskphp.blogspot.com/2011/10/php-mailserver.html' title='Php - mailserver'/><author><name>JohannesMattsson</name><uri>http://www.blogger.com/profile/15885527309233775321</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtvwYLqczGjKRZuVnHooye5CM0j_nb-pF5vPHCFs3OMyEamHoYrneix3Mo_NiCSjhmV41MzNwmNbanzHf0MYtAGEr44JBBAnIkj_9QNpbDWwbVNZxv8FrdaitNww19hDY/s220/DSC05037jhvgjhv.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3681402488843432710.post-7738794142509326155</id><published>2011-10-11T16:39:00.000+02:00</published><updated>2011-10-12T13:21:24.309+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Lära sig php"/><category scheme="http://www.blogger.com/atom/ns#" term="Lära sig php på svenska"/><category scheme="http://www.blogger.com/atom/ns#" term="php svenska"/><category scheme="http://www.blogger.com/atom/ns#" term="svensk php"/><category scheme="http://www.blogger.com/atom/ns#" term="virtuell server php svenska"/><category scheme="http://www.blogger.com/atom/ns#" term="virtuell server svenska"/><category scheme="http://www.blogger.com/atom/ns#" term="xampp på svenska"/><title type='text'>Introduktion till PHP</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: x-large;&quot;&gt;&lt;b&gt;Introduktion&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Denna introduktion kommer vara kort men effektiv, tanken är att du ska försöka dig fram själv, learn by doing är i de flesta fall överlägset när det kommer till att komma ihåg kunskap.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Tanken är att ni ska få en knuff i rätt riktning nu i början för att sedan försöka själva med mer avancerade saker, jag är helt självlärd, på både gott och ont.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;PHP står för&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: sans-serif; line-height: 19px;&quot;&gt;&lt;i style=&quot;font-size: 13px;&quot;&gt;Hypertext Preprocessor &lt;/i&gt;och används främst för webben.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: sans-serif; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;PHP är ett utmärkt sätt att utöka sina färdigheter inom webbutveckling eller dylikt.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;Det rekommenderas starkt att du har en grundläggande kunskap inom HTML innan du börjar med PHP, men alla lär sig olika.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;b&gt;Har du ingen webbserver att testa emot?&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;Det första vi kommer göra är att ladda ner apache xampp. Du förstår förmodligen inte vad det betyder kortfattat skapas en virtuell server på din dator, där du kan skapa hemsidor och testköra kod.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;b&gt;Steg1&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;Ladda ner &lt;a href=&quot;http://www.apachefriends.org/download.php?xampp-win32-1.7.7-VC9-installer.exe&quot;&gt;Xampp för Windows&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;b&gt;Steg2&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;Installera efter angivna platser&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;b&gt;Steg3&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;Kontrollera installationen genom att skriva &quot;localhost&quot; i din webbläsare. (127.0.0.1 i Internet Explorer ifall det inte fungerar med localhost)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;b&gt;Har du en webbserver eller virtuell server:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;För att börja använda PHP gör du likadant som ifall du skulle göra en htmlfil. Men filändelsen ska vara .php istället för .html&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;index.php = PHP&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;index.html = HTML&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;När du skapat en .php fil, så testa skriv följande&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;echo &#39;Hejhopp&#39;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;b&gt;Spara filen på webbserven, eller för virtuell server (c:/xampp/htdocs/)&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;Öppna sedan in webbläsare och skriv in url-vägen till din fil.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;i&gt;Exempel localhost/index.php&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;Detta kommer att skriva ut &quot;hejhopp&quot;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;Det som finns inom &amp;lt;?php och ?&amp;gt; är phpkod.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;echo används för att skriva ut data.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;Varje rad i PHP avslutas med ett semikolon.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://svenskphp.blogspot.com/feeds/7738794142509326155/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://svenskphp.blogspot.com/2011/10/introduktion-till-php.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/7738794142509326155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/7738794142509326155'/><link rel='alternate' type='text/html' href='http://svenskphp.blogspot.com/2011/10/introduktion-till-php.html' title='Introduktion till PHP'/><author><name>JohannesMattsson</name><uri>http://www.blogger.com/profile/15885527309233775321</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtvwYLqczGjKRZuVnHooye5CM0j_nb-pF5vPHCFs3OMyEamHoYrneix3Mo_NiCSjhmV41MzNwmNbanzHf0MYtAGEr44JBBAnIkj_9QNpbDWwbVNZxv8FrdaitNww19hDY/s220/DSC05037jhvgjhv.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3681402488843432710.post-2658322083290713832</id><published>2011-10-11T10:13:00.000+02:00</published><updated>2011-10-11T10:52:16.773+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dynamisk"/><category scheme="http://www.blogger.com/atom/ns#" term="dynamisk php"/><category scheme="http://www.blogger.com/atom/ns#" term="dynamiska php menyer"/><category scheme="http://www.blogger.com/atom/ns#" term="php för svenska"/><category scheme="http://www.blogger.com/atom/ns#" term="php menyer"/><category scheme="http://www.blogger.com/atom/ns#" term="php på svenska"/><category scheme="http://www.blogger.com/atom/ns#" term="phpfunktioner"/><title type='text'>Skapa en dynamisk PHP-Mysql sida</title><content type='html'>I detta inlägg kommer jag gå igenom hur du ska göra för att skapa en dynamisk sida, som hämtar information från databasen för varje sida du är inne på.&lt;br /&gt;
&lt;br /&gt;
Detta sköts genom att länka tex &quot;index.php?id=1&quot; till att hämta data från vår databas.&lt;br /&gt;
Nedan är ett enkelt exempel:&lt;br /&gt;
&lt;br /&gt;
1. Först behöver du skapa en ny tabell i din databas, döp den till pages(eller det som passar)&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;CREATE TABLE IF NOT EXISTS `pages` (&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; `id` int(11) NOT NULL AUTO_INCREMENT,&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; `body` text NOT NULL,&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; PRIMARY KEY (`id`)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;) ENGINE=InnoDB &amp;nbsp;DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;--&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;-- Data i tabell `pages`&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;--&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;INSERT INTO `pages` (`id`, `body`) VALUES&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;(1, &#39;Text till sida 1&#39;),&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;(2, &#39;Text till sida 2&#39;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
Nu har du skapat en tabell som heter pages, som har en unik id, och text för varje sida.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Nu ska vi använda oss av PHP för att bygga ett enkelt menysystem, där vi ska länka till våra sidor.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;Jag kommer använda funktioner, se tidigare inlägg &lt;a href=&quot;http://svenskphp.blogspot.com/2011/10/php-funktioner-ansluta-till-en-mysql.html&quot;&gt;Funktioner &lt;/a&gt;för mer information.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Det första vi ska göra är att skapa en variabel&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;nbsp;$pageid = $_GET[&#39;pid&#39;];&lt;/span&gt;&lt;br /&gt;
Variabeln $pageid får värdet som skickas via pid&lt;br /&gt;
&lt;br /&gt;
Sedan skapar jag en testlänk, Ifall du trycker på den så ska $pageid få värdet 1, testa skriva ut $pageid för att se att allt fungerar.&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;&amp;lt;a href=&quot;index.php?pid=&quot;1&quot;&amp;gt;sida1&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Nu när allt verkar fungera, så ska vi radera länken vi nyss gjorde, och göra nya, dynamiska länkar som visas beroende på vad vi har för information i databasen.&lt;br /&gt;
&lt;br /&gt;
Under variabeln $pageid skriver jag:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;$page= execute_query(&quot;SELECT id, body FROM `pages` where id =&#39;$pageid&#39;&quot;);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;foreach($page as $page) {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;$body = $page[&#39;body&#39;];&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
Här hämtar vi body från databasen, där id är densamma som $pageid.&lt;br /&gt;
Så ifall $pageid är 1, så hämtas också texten ur body där id är ett.&lt;br /&gt;
&lt;br /&gt;
Jag tror ni börjar fatta galoppen nu.&lt;br /&gt;
Det vi ska göra nu är att skriva ut länkarna, detta gör vi på ett liknande sätt:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;$menu= execute_query(&quot;SELECT id FROM `pages`&quot;);&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;foreach($menu as $menu) {&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;echo &#39;&amp;lt;a href=&quot;index.php?pid=&#39;.$menu[&#39;id&#39;].&#39;&quot;&amp;gt;&#39;.$menu[&#39;id&#39;].&#39;&amp;lt;/a&amp;gt;&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
Det sista som behöver göras är att skriva ut variabeln $body, lägg den mellan &amp;lt;body&amp;gt; och &amp;lt;/body&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Viktigt!&lt;/b&gt;&lt;br /&gt;
Du bör ändra din $pageid variabel till:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;$pageid = preg_replace(&quot;[^0-9]&quot;,&quot;&quot;,$_GET[&#39;pid&#39;]);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;$pageid = preg_replace(&#39;/\/[a-z][a-z]\//&#39;, &#39;/&#39;, $_GET[&#39;pid&#39;]);&lt;/span&gt;&lt;br /&gt;
Detta används för att förhindra mysql-injection, din sida blir säkrare. (preg_replace kan variera beroende på viljen php-version du kör, får du upp felkoder kan du testa ändra till ereg_replace, annars kolla upp på php-net)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hela php-koden:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;include_once(&quot;database.php&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;$pageid = $_GET[&#39;pid&#39;];&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;$page= execute_query(&quot;SELECT id, body FROM `pages` where id =&#39;$pageid&#39;&quot;);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;foreach($page as $page) {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;$body = $page[&#39;body&#39;];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;$menu= execute_query(&quot;SELECT id FROM `pages`&quot;);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;foreach($menu as $menu) {&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;echo &#39;&amp;lt;a href=&quot;index.php?pid=&#39;.$menu[&#39;id&#39;].&#39;&quot;&amp;gt;&#39;.$menu[&#39;id&#39;].&#39;&amp;lt;/a&amp;gt;&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;&amp;lt;?php echo $body; ?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red; font-size: x-small;&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://svenskphp.blogspot.com/feeds/2658322083290713832/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://svenskphp.blogspot.com/2011/10/skapa-en-dynamisk-php-mysql-sida.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/2658322083290713832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/2658322083290713832'/><link rel='alternate' type='text/html' href='http://svenskphp.blogspot.com/2011/10/skapa-en-dynamisk-php-mysql-sida.html' title='Skapa en dynamisk PHP-Mysql sida'/><author><name>JohannesMattsson</name><uri>http://www.blogger.com/profile/15885527309233775321</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtvwYLqczGjKRZuVnHooye5CM0j_nb-pF5vPHCFs3OMyEamHoYrneix3Mo_NiCSjhmV41MzNwmNbanzHf0MYtAGEr44JBBAnIkj_9QNpbDWwbVNZxv8FrdaitNww19hDY/s220/DSC05037jhvgjhv.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3681402488843432710.post-381865993042440223</id><published>2011-10-10T23:21:00.000+02:00</published><updated>2011-10-11T16:45:34.831+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="anslut till mysql php"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql"/><category scheme="http://www.blogger.com/atom/ns#" term="mysql php"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="php för svenska"/><category scheme="http://www.blogger.com/atom/ns#" term="php på svenska"/><category scheme="http://www.blogger.com/atom/ns#" term="svenska"/><title type='text'>Anslut till mysql-databas</title><content type='html'>&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Anslut till mysql-databas med &quot;traditionella&quot; metoden.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Detta kan användas för er som redan använder denna metod, men kanske vill se hur andra har gjort, om du är ny för detta rekommenderar jag dig att titta in tidigare inlägg &lt;a href=&quot;http://svenskphp.blogspot.com/2011/10/php-funktioner-ansluta-till-en-mysql.html&quot;&gt;php-mysql funktioner&lt;/a&gt;. Även ifall exemplet i detta inlägg kan se enklare ut, så kommer du spara mycket tid och energi att lära dig funktioner direkt.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Steg1&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Skapa en&amp;nbsp;fil med namnet&amp;nbsp;connect_to_mysql.php&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;&amp;lt;?php&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;// db host-namn. &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;$db_host = &quot;localhost&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;//användarnamn för MySQL databas&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;$db_username = &quot;&quot;;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;//Lösenord för MySQL databas&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;$db_pass = &quot;&quot;;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;//namn för MySQL databas&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;$db_name = &quot;&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;//Anslutning&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;$myConnection = mysql_connect(&quot;$db_host&quot;,&quot;$db_username&quot;,&quot;$db_pass&quot;, &quot;$db_name&quot;) or die (&quot;could not connect to mysql&quot;);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Ändra db_host,db_username,db_pass,db_name till dina egna värden.&lt;/i&gt;&lt;br /&gt;
Det vi har gjort nu är att lagt alla våra inloggningsuppgifter och skapat en &quot;mysql_connect&quot;, vi ansluter alltså till vår databas via variabeln $myConnection&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Steg2&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Skapa en index.php fil:&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;include_once &quot;connect_to_mysql.php&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;$sqlCommand =&quot;SELECT id FROM `clients`&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;$query = mysql_query($myConnection, $sqlCommand) or die (mysql_error());&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;while($row = mysql_fetch_array($query)){&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;echo $row[&#39;id&#39;];&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;echo &#39;&amp;lt;br /&amp;gt;&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
Vi inkluderar vår connect_to_database.php fil. Sedan skapar vi en variabel $sqlCommand, vilket innehåller vår fråga till databasen (ändras för eget behov).&lt;br /&gt;
&lt;br /&gt;
Sedan skapar vi en till variabel &quot;$query&quot;, i den säger vi att det ska anslutas till databasen, med värdena från $myConnection, och frågan som ska köras är från $query.&lt;br /&gt;
&lt;br /&gt;
För att sedan skriva ut detta använder vi en While-loop. Vi säger att sålänge $row (vilket är en php variabel med ganska självförklarande namn) är lika med att det hämtas data från mysql-databasen.&lt;br /&gt;
&lt;br /&gt;
Så ska vi skriva ut $row[&#39;id&#39;];&lt;br /&gt;
&lt;br /&gt;
Ifall du inte förstår $row[&#39;id&#39;] så kan du snabbt läsa upp dig på php-arrayer &lt;a href=&quot;http://php.net/manual/en/language.types.array.php&quot;&gt;här&lt;/a&gt;, eller skriva en kommentar så hjälper jag gärna till.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Testa och kör! (glöm inte att ändra datan i connect_to_mysql.php och index.php så det överensstämmer med din databas)&lt;br /&gt;
&lt;br /&gt;
Lycka till!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://svenskphp.blogspot.com/feeds/381865993042440223/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://svenskphp.blogspot.com/2011/10/anslut-till-mysql-databas.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/381865993042440223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/381865993042440223'/><link rel='alternate' type='text/html' href='http://svenskphp.blogspot.com/2011/10/anslut-till-mysql-databas.html' title='Anslut till mysql-databas'/><author><name>JohannesMattsson</name><uri>http://www.blogger.com/profile/15885527309233775321</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtvwYLqczGjKRZuVnHooye5CM0j_nb-pF5vPHCFs3OMyEamHoYrneix3Mo_NiCSjhmV41MzNwmNbanzHf0MYtAGEr44JBBAnIkj_9QNpbDWwbVNZxv8FrdaitNww19hDY/s220/DSC05037jhvgjhv.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3681402488843432710.post-3892153697510268196</id><published>2011-10-10T22:40:00.000+02:00</published><updated>2011-10-10T23:21:44.106+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="funktioner"/><category scheme="http://www.blogger.com/atom/ns#" term="guide"/><category scheme="http://www.blogger.com/atom/ns#" term="lathund"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="phpfunktioner"/><category scheme="http://www.blogger.com/atom/ns#" term="svenska"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><title type='text'>PHP-funktioner, anslut till en mysql databas</title><content type='html'>&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: large;&quot;&gt;&lt;b&gt;PHP funktioner - ansluta till en mysql databas&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Jag hittade ett inlägg på bl.a&amp;nbsp;&lt;a href=&quot;http://www.paulwest.co.uk/article.php/php-database-functions&quot;&gt;Paulwest&lt;/a&gt;&amp;nbsp;(Den finns dock på flera ställen, vet inte vem som var först)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Där används php-funktioner för att ansluta, och skicka frågor till en mysql databas, tex &quot;phpmyadmin&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Följande kod har jag lagt i en phpfil och döpt till &quot;database.php&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Allt som behöver ändras är de första raderna &quot;db_server,db_user,db_password,db_table&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;(Jag använder php 5)&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;code&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;function connect() {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;$db_server = &#39;localhost&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;$db_user = &#39;&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;$db_password = &#39;&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;$db_table = &#39;&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;$con = mysql_connect($db_server, $db_user, $db_password);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;if(!$con){&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp; rigger_error(&quot;Problem connecting to server&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;$db = &amp;nbsp;mysql_select_db($db_table, $con);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp; if(!$db){&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;trigger_error(&quot;Problem selecting database&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;return $con;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;//Stäng&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;function disconnect($con) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;$discdb = mysql_close($con);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp; if(!$discdb){&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp; &amp;nbsp;trigger_error(&quot;Problem disconnecting database&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;//Kör frågor&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;function execute_query($sql) {&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;$con = connect();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;$result = mysql_query($sql, $con);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;if(!$result){&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp; trigger_error(&quot;Problem slecting data&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;while($row = mysql_fetch_array($result, MYSQL_ASSOC)){&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp; $result_array[] = $row;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;disconnect($con);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;return $result_array;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;//Uppdatera&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;function execute_update($sql){&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;$con = connect();&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;$result = mysql_query($sql, $con);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;if(!$result){&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp; trigger_error(&quot;Problem updating data&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;nbsp;disconnect($con);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/code&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Nu har du en komplett fil med funktioner för att köra frågor, uppdatera och radera till din databas.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: large;&quot;&gt;&lt;b&gt;Användning:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;För att använda funktionerna för att tex hämta data så har jag gjort följande:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;1.skapa en index.php fil.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;2.Skriv:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;include_once(&quot;database.php&quot;); //vägen till database.php&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;$clients = execute_query(&quot;SELECT id FROM `clients`&quot;); //Väljer ut id från clients, ändras efter egen databas!&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;foreach($clients as $clients) { //Ändra variabeln clients till något som passar&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;echo $clients[&#39;id&#39;]; //Skriver ut id&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;echo &#39;&amp;lt;br /&amp;gt;&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #0b5394; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: xx-small;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: large;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: large;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://svenskphp.blogspot.com/feeds/3892153697510268196/comments/default' title='Kommentarer till inlägget'/><link rel='replies' type='text/html' href='http://svenskphp.blogspot.com/2011/10/php-funktioner-ansluta-till-en-mysql.html#comment-form' title='0 kommentarer'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/3892153697510268196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3681402488843432710/posts/default/3892153697510268196'/><link rel='alternate' type='text/html' href='http://svenskphp.blogspot.com/2011/10/php-funktioner-ansluta-till-en-mysql.html' title='PHP-funktioner, anslut till en mysql databas'/><author><name>JohannesMattsson</name><uri>http://www.blogger.com/profile/15885527309233775321</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtvwYLqczGjKRZuVnHooye5CM0j_nb-pF5vPHCFs3OMyEamHoYrneix3Mo_NiCSjhmV41MzNwmNbanzHf0MYtAGEr44JBBAnIkj_9QNpbDWwbVNZxv8FrdaitNww19hDY/s220/DSC05037jhvgjhv.jpg'/></author><thr:total>0</thr:total></entry></feed>