Jump to content

vic3685

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

vic3685's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks so much. Now I can google it :-D
  2. I'm not sure I want subdomains. I mean... do you think Facebook has subdomains for every user page? I think there's got to be another way...
  3. I would love to google my question, but I don't know how this is called.... I want to create URLs for each user of a site with this format: www.mysite.com/user1 Facebook does this, for example. In a static page I'd do it with a folder and index file for each user, but that's not practical if you have too many users. Could you explain how this is done or at least how it is called so I can find myself something to read? Thanks!!!
  4. Hi everyone! I'm new around here, not sure if this is the right place to ask my question. I have just designed my first CMS, all by myself, but I'm having some trouble. The thing is, after doing an edit, the admin won't automatically update the information, so it looks like it didn't really do the edit. It edits the content alright, the front-end does show the changes, but I can't get the back-end to automatically refresh. So far, I've only tried with <META HTTP-EQUIV="Pragma" CONTENT="no-cache">, which didn't help. It happens with all the actions I have on my CMS (create, edit and delete). To give you an example, I'm going to use the simplest of the codes, and just take the example of a text edit function. Could you help me figure it out? Thanks a lot! The code is as follows: <?php $admin_root = ""; $root = "../"; require_once($root."includes/functions.php"); require_once($root."includes/connect.php"); ?> <!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" /><META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <title>Administración: La empresa</title> <link type="text/css" href="<?php echo $admin_root; ?>admin.css" rel="stylesheet" /> <script type="text/javascript" src="<?php echo $root;?>scripts/jquery-1.4.2.min.js" ></script> <script type="text/javascript" src="<?php echo $root;?>scripts/jquery-ui-1.8.6.custom.min.js"></script> <!-- //CKEditor --> <script type="text/javascript" src="<?php echo $root;?>/scripts/ckeditor/ckeditor.js"></script> </head> <body> <div id="container"> <?php include("includes/header.php"); //HEADER ?> <div id="content" style="color:"> <?php #/ Form to displayed function defaultForm() { //get existing text $empresa = get_datos_empresa(); $empresa_txt = mysql_fetch_array($empresa); echo "<script type='text/javascript'> CKEDITOR.replace( 'empresa' );</script>"; global $empresa_txt; echo "<form method=\"post\" enctype=\"multipart/form-data\" id='empresa_form'>\n"; echo "<h1>La empresa: </h1>"; echo "<textarea name='empresa' rows='10' cols='90' id='empresa'>".$empresa_txt['contenido']."</textarea> "; echo "<input name=\"Submit\" type=\"submit\" value=\"Submit\">\n"; echo "<input name=\"filter\" type=\"hidden\" value=\"processForm\">\n"; ##/ hidden value points the switch to processing echo "</form>"; echo "<script type='text/javascript'> CKEDITOR.replace( 'empresa' );</script>"; return; } #/ End of defaultForm ##/ Function that displays forms and is called by default function processForm() { global $connection; global $empresa_txt; $message = ""; //RECEIVE VALUES //empresa $emp_contenido = mysql_prep($_POST['empresa']); //UPLOAD VALUES: empresa $query = "UPDATE empresa SET contenido = '{$emp_contenido}' WHERE tipo = 'empresa' "; $result = mysql_query($query, $connection); if (mysql_affected_rows() == 1) { // Success $message .= "It succeeded." ; } elseif (!mysql_error() | mysql_error() == "") { // No change was requested $no = 1; } else { // Failed $message .= "The text could not be updated."; $message .= " ". mysql_error(); } if ($message == "") {$message = "No change was requested.";} $message .= " ". "<a href='".$menu_root."edit_empresa.php'>Back</a>"; echo $message; return; } #/ End of processForm ##/ This object handles which function the application should call switch($_POST[filter]) { case "processForm": processForm($cat_cod, $cat_txt, $cat_type, $connection); break; default: defaultForm($opciones_cat); break; } #/ End of Handling ?> </div> <?php include("includes/footer.php"); ?> </div> </body> </html> <?php // 5. Close connection mysql_close($connection);
  5. Anybody? Here's the code I'm using: <?php // Define your email address - where to send messages - here define("MAIL_TARGET","EMAIL@EMAIL.com"); // Here you can redefine error messages define("errorName","Nombre no valido"); define("errorEmail","Direccion de email no valida!"); define("errorMsg","Debe tener por lo menos 10 caracteres"); function createForm($name="",$email="",$message="",$error1="",$error2="",$error3=""){ ?> ------------ <?php } function isValidEmail($email){ $pattern = "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$"; if (eregi($pattern, $email)){ return true; } else { return false; } } function sendMail($name,$email,$message){ $subject = "contacto de pag web"; $from = "From: $name <$email>\r\nReply-To: $email\r\n"; $header = "MIME-Version: 1.0\r\n"."Content-type: text/html; charset=utf-8\r\n"; $content = htmlspecialchars($message); $content = wordwrap($content,70); mail(MAIL_TARGET,$subject,$content,$from.$header); } ?> --------- <?php if (!isset($_POST['submitBtn'])) { createForm(); } else { $name = isset($_POST['name']) ? $_POST['name'] : ""; $email = isset($_POST['email']) ? $_POST['email'] : ""; $message = isset($_POST['message']) ? $_POST['message'] : ""; $error = false; if (strlen($name)<2) { $error = true; $error1 = errorName; } if (!isValidEmail($email)) { $error = true; $error2 = errorEmail; } if (strlen($message)<10) { $error = true; $error3 = errorMsg; } if ($error){ createForm($name,$email,$message,$error1,$error2,$error3); } else { sendMail($name,$email,$message); ?>
  6. Hi everyone, I'm a bit puzzled by a contact form that is not working properly. I'm from Argentina, so we use accents and some other special characters, which are giving me a hard time. Now I changed the charset to UTF-8, and here's what puzzles me: it works when it goes to my Hotmail account, but doesn't work when going to my client's account. I would say it's a mail server issue, not something with the form itself, do you agree? Is there a way around this? I'd love to hear suggestions. Thank you for hour help! Vicky
×
×
  • 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.