Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo "<div class='wider'>";
- $sql = mysql_query("SELECT * FROM pages WHERE section = 'start'");
- $res = mysql_fetch_array($sql);
- $res = utf8fix($res);
- if (isset($_POST['submit'])){
- $search = array('<strong>','</strong>','<em>','</em>','Å','Ä','Ö','å','ä','ö');
- $replace = array('<b>','</b>','<i>','</i>','Å','Ä','Ö','å','ä','ö');
- $post = str_replace($search,$replace,$_POST['value']);
- $headline = str_replace($search,$replace,$_POST['headline']);
- $plats = $_POST['plats'];
- $target_path = "../frontbild/";
- $target_path = $target_path . basename( $_FILES['bild']['name']);
- $fil = basename( $_FILES['bild']['name']);
- if (move_uploaded_file($_FILES['bild']['tmp_name'], $target_path)) {
- echo basename( $_FILES['bild']['name']). " laddades upp och texten sparades och publicerades.<br />";
- } else {
- echo "Ingen bild laddades upp, men texten sparades i databasen!<br />";
- }
- mysql_query("UPDATE pages SET headline = '$headline', value = '$post', bild = '$fil', location = '$plats' WHERE section = 'start'") or die(mysql_error());
- }
- if (!isset($_POST["submit"])) {
- include(INC.'/tinymce.php');
- echo utf8fix("<div id='ruttitel-wide'><h4>Redigera Förstasidan</h4></div><div id='ruta-wide'>
- <form enctype='multipart/form-data' action='settings.php?setting=front' method='post'>
- <INPUT TYPE='TEXT' NAME='headline' VALUE='".$res['headline']."' SIZE=49>
- <TEXTAREA NAME='value' rows='25' style='margin-bottom: 5px;'>".$res['value']."</TEXTAREA>
- Bild: <input name='bild' type='file' SIZE=30 /><br /><br />
- <input type='submit' name='submit' value='Utför' style='float: right; margin-top: 5px;'>
- Bildplacering <input type='radio' name='plats' id='left' value='left' "); if( $res['location' ] == "left" ) { echo "checked='checked' "; } echo utf8fix ("/>Vänster
- <input type='radio' name='plats' id='right' value='right' "); if( $res['location'] == "right" ) { echo "checked='checked' "; } echo utf8fix (" />Höger<br />
- </form></div><br />");
- }
Add Comment
Please, Sign In to add comment