Jump to content

alexander007

Members
  • Posts

    42
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

alexander007's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I think of that But I dont want to have the script that delete the files on other file...
  2. <?php function showContent($path){ if ($handle = opendir($path)) { $up = substr($path, 0, (strrpos(dirname($path."/."),"/"))); echo "<thead><tr><th colspan='3'><center>RECURSOS</center></th></tr></thead>"; while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $fName = $file; $file = $path.'/'.$file; if(is_file($file)) { echo "<tr><td><img src='../media/images/file2.gif' width='16' height='16' alt='file'/> <a href='".$file."'>".$fName."</a></td>" ."<td align='right'>".date ('d-m-Y H:i:s', filemtime($file))."</td>" ."<td align='right'>".filesize($file)." bytes</td>" ."<td align='right'><a href='".unlink($fName)."'>Borrar</a></td></tr>"; } elseif (is_dir($file)) { print "<tr><td colspan='2'><img src='style/dir2.gif' width='16' height='16' alt='dir'/> <a href='".$_SERVER['PHP_SELF']."?path=$file'>$fName</a></td></tr>"; } } } closedir($handle); } } $actpath = "../recursos/"; ?>
  3. Is there a way to delete a file within a directory using a link? I have a script that will list all the files in a directory and, in the output, I'd like to create a link next to each file that says "delete This file" and then will delete the file from the /dir filename1.jpg delete file filename2.jpg delete file filename3.jpg delete file filename4.jpg delete file I try but when I click on the delete button I delete all the files of the /dir...
  4. Im still getting the same error.. failed to open stream: Is a directory in....
  5. Im trying to copy a file from the root of my website to other folder.. $source='/home/content/maunalava/html/dev-netteampr/portales/index.php'; $destination=('/home/content/maunalava/html/dev-netteampr/portales/' . $usuario); copy($source, $destination); But I keep getting...failed to open stream: Is a directory in....
  6. Something very simple... <?php include"../include/config.php"; $tbl_name="login"; // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from signup form $username=$_POST['username']; $password=$_POST['password']; $encrypted_password=md5($password); $sql="SELECT * FROM $tbl_name WHERE username='$username' and password='$encrypted_password'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $username and $password, table row must be 1 row if($count==1){ // Register $username, $password and redirect to file "menu.php" session_register("username"); session_register("password"); header("location:sistema.html"); } else { echo "Wrong Username or Password"; } ?> At top of every page <?php session_start(); if(!session_is_registered(username)){ header("location:../admin/"); } Logout <?php session_start(); session_destroy(); header("location:../admin"); ?>
  7. This is my code...Im using radio buttons... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Manejador de Contenidos</title> <?php require_once("../include/header.inc.php"); require_once( DIRECTORY_PATH_INC . 'utils.inc.php'); require_once( DIRECTORY_PATH_INC . 'db.inc.php'); global $contenido; function LoadGreeting(){ $contenido = "Este es el Manejador de Contenidos de su Pagina Seleccione del Menu"; echo $contenido; } function ContentLoad(){ echo $_POST['Categories']; if ($_POST['Categories'] = "Main Page") $category = "Main Page"; if ($_POST['Categories'] = "Tour") $category = "Tour"; echo $category; $query = "SELECT `Contenido` FROM `Content` WHERE `Category` = '$category'"; $contenido = db_value($query); echo $contenido; } function SaveContent2(){ $query = "UPDATE `Content` SET `Contenido`= '$newContent' WHERE `ID` = 1"; $greeting = db_res($query); echo "Contenido Guardado"; } ?> <script type="text/javascript" src="../plugins/tiny_mce/tiny_mce_src.js"></script> <script language="javascript" type="text/javascript"> tinyMCE.init({ mode : "textareas", theme : "advanced", plugins : "fullpage", theme_advanced_buttons3_add : "fullpage" }); function Load() { var inst = tinyMCE.getInstanceById('content'); inst.setHTML('<?php ContentLoad();?>'); } function Save() { var inst = tinyMCE.getInstanceById('content'); tinyMCE.triggerSave(true,true); //alert(inst.getHTML()); } function saveContent(content, id) { alert('The content for "' + id + '" has been saved'); http.open("GET", "save_content.php?id=" + id + "&content=" + escape(content), true); http.onreadystatechange = handleHttpResponse(id); http.send(null); } </script> </head> <body> <form id="form1" name="form1" method="post" action=""> <p> <label> <input type="radio" name="Categories" value="Main Page" id="Categories_0" /> Main Page</label> <br /> <label> <input type="radio" name="Categories" value="Tour" id="Categories_1" /> Tour</label> <br /> </p> <input type="button" value="Cargar" onclick="Load();" /> <input name="Reset" type="reset" value="Comenzar de Nuevo" /> </form> <textarea id="content" name="content" cols="85" rows="25" class="mceAdvanced"><?php LoadGreeting();?></textarea><br /> <input type="button" value="Save" onclick="saveContent(inst.getHTML(), 1)" /> <!--<form method="post" action="edit_content.php"> name="cat" onclick="Load();" <input type="button" value="Load" onclick= "Load();" /> <textarea name="index_content" cols="90" rows="15">Wooo This is some content that will be editable with TinyMCE.</textarea> <input type="submit" value="Submit" /> </form> --> </body> </html>
  8. INSERT INTO table_name (column1, column2,...) VALUES (value1, value2,....)
  9. yeah I know that...I try that...but the problem is that Im only retreaving only one value...
  10. HOw I can load the content for the area from a database using a dropdown menu? I try but i cant makeit o work... heres the sample code from tinymce wiki... tinyMCE.init({ mode : "textareas", theme : "advanced" }); function ajaxLoad() { var inst = tinyMCE.getInstanceById('content'); // Do you ajax call here inst.setHTML('HTML content that got passed from server.'); } function ajaxSave() { var inst = tinyMCE.getInstanceById('content'); // Do you ajax call here alert(inst.getHTML()); }
  11. Query was empty...I dont understant why the query is empty ???
  12. I have this... <?php include"include/config.php"; $tbl_name="clientes"; $nombre=$_POST['nombre']; $telefono=$_POST['telefono']; $email=$_POST['email']; $usuario=$_POST['usuario']; $referido=$_POST['referido']; if($nombre==NULL|$telefono==NULL|$email==NULL|$usuario==NULL) { echo "<h3><center>Favor de llenar todos los campos.</center></h3>"; } else { mysql_query("INSERT INTO `$tbl_name` VALUES (NULL, '$nombre', '$telefono', '$email', '$usuario', NULL)"); mysql_query("UPDATE `$tbl_name` SET referidos=referidos+1 WHERE usuario='$referido'"); } mkdir("/home/content/m/a/u/maunalava/html/dev-netteampr/travel/".$usuario, 0777) ?> I dont know why is not inserting the values on the table...
  13. Yes,,,but something very simple...they are only four pages...it very simple...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.