Ver Mensaje Individual
  #10 (permalink)  
Antiguo 15/07/2010, 13:57
w0rldart
 
Fecha de Ingreso: junio-2009
Ubicación: Madrid
Mensajes: 402
Antigüedad: 14 años, 10 meses
Puntos: 20
Respuesta: PHP dynamic website

Vengo con un problema de header, de los formularios que tengo

Código:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/e/d/h/edh0sting/html/modules/contact/work.php:1) in /home/content/e/d/h/edh0sting/html/modules/contact/work.php  on line 4

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/e/d/h/edh0sting/html/modules/contact/work.php:1) in /home/content/e/d/h/edh0sting/html/modules/contact/work.php on line 4
Esto es lo que genera
Código PHP:
<?php

session_name
("fancyform");
session_start();


$_SESSION['n1'] = rand(1,20);
$_SESSION['n2'] = rand(1,20);
$_SESSION['expect'] = $_SESSION['n1']+$_SESSION['n2'];


$str='';
if(
$_SESSION['errStr'])
{
    
$str='<div class="error">'.$_SESSION['errStr'].'</div>';
    unset(
$_SESSION['errStr']);
}

$success='';
if(
$_SESSION['sent'])
{
    
$success='<h1>Thank you!</h1>';
    
    
$css='<style type="text/css">#contact-form{display:none;}</style>';
    
    unset(
$_SESSION['sent']);
}
?>
He mirado aqui y en otros sitios intentando buscar una solucion, pero si exito. Espero que me podeis hechar una mano con esto.

Y tambien, alguna recomendacion al respeto de la web? Quiero hacer las urls amigables... y por lo tanto lo intento con este .htaccess, copiado del drupal que instale y todavia lo estoy modificando pero me interesa si teneis alguna sugerencia al respeto ya que no consigo esas urls amigables:
Código:
#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
  Order allow,deny
</FilesMatch>

# Don't show directory listings for URLs which map to a directory.
Options -Indexes

# Follow symbolic links in this directory.
Options +FollowSymLinks

# Set the default handler.
DirectoryIndex index.php

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # Enable expirations.
  ExpiresActive On

  # Cache all files for 2 weeks after access (A).
  ExpiresDefault A1209600

  <FilesMatch \.php$>
    # Do not allow PHP scripts to be cached unless they explicitly send cache
    # headers themselves. Otherwise all scripts would have to overwrite the
    # headers set by mod_expires if they want another caching behavior. This may
    # fail if an error occurs early in the bootstrap process, and it may cause
    # problems if a non-Drupal PHP file is installed in a subdirectory.
    ExpiresActive Off
  </FilesMatch>
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on

  # If your site can be accessed both with and without the 'www.' prefix, you
  # can use one of the following settings to redirect users to your preferred
  # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  #
  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
  #
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # uncomment and adapt the following:
  # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

  # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  # VirtualDocumentRoot and the rewrite rules are not working properly.
  # For example if your site is at http://example.com/drupal uncomment and
  # modify the following line:
  # RewriteBase /drupal
  #
  # If your site is running in a VirtualDocumentRoot at http://example.com/,
  # uncomment the following line:
  # RewriteBase /

  # Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^mod([^/]*).html$ index.php?mod=$1 [L]
</IfModule>

# $Id: .htaccess,v 1.90.2.5 2010/02/02 07:25:22 dries Exp $