Visualizzazione dei risultati da 1 a 9 su 9
  1. #1

    Warning: Header may not contain more than a single header, new line detected. in

    questo codice mi da l'errore

    Codice PHP:
        if (!validEmail($Email))
      {
      
       
    header("Location:[url]http://www.miosito.it/contacts.php?msg=the[/url] email is incorrect&name=".$_REQUEST['Name']."&company=".$_REQUEST['Company']."&email=".$_REQUEST['Email']."&phone=".$_REQUEST['Phone']."&country=".$_REQUEST['Country']."&notes=".$_POST['Notes']);
       
       }else{
       
       
    header("Location:[url]http://www.miosito.it/contacts.php?msg=Please[/url] fill the mandatory fields, thank you&name=".$_REQUEST['Name']."&company=".$_REQUEST['Company']."&email=".$_REQUEST['Email']."&phone=".$_REQUEST['Phone']."&country=".$_REQUEST['Country']."&notes=".$_POST['Notes']);

    ma non funzione nemmeno con trim e con urlencode

    così
    Codice PHP:
      $what3 "Location:[url]http://www.miosito.it/contacts.php?msg=Please[/url] fill the mandatory fields, thank you&name=".$_REQUEST['Name']."&company=".$_REQUEST['Company']."&email=".$_REQUEST['Email']."&phone=".$_REQUEST['Phone']."&country=".$_REQUEST['Country']."&notes=".$_POST['Notes'];

    $what3 trim($what3);
    $what3 rawurlencode($what3);
      
      
    header("Location: [url]http://www.miosito.it/contacts.php[/url]".$what3); 
    come si risolve questo problema in php??

    grazie dell'aiuto

  2. #2
    dà errore? ma no...che strano...

    magari prima leggi la documentazione della funzione header (http://php.net/manual/en/function.header.php)

    ma quel codice lì da dove salta fuori?
    cioè è totalmenmte privo di senso...

    cos'è che vuoi ottenere esattamente???

  3. #3
    Prova cosi
    Codice PHP:
    <?php 
    $what3 
    "http://www.miosito.it/contacts.php?msg=Please fill the mandatory fields, thank you&name=".$_REQUEST['Name']."&company=".$_REQUEST['Company']."&email=".$_REQUEST['Email']."&phone=".$_REQUEST['Phone']."&country=".$_REQUEST['Country']."&notes=".$_POST['Notes'];
    $what3 trim($what3); 
    $what3 rawurlencode($what3);
    header("Location: $what3");
    ?>

  4. #4
    grazie, delle risposte se faccio così

    header("Location: $what3");
    mi da

    Not Found

    The requested URL
    /http://www.miosito.it/contacts.php?msg=the email is incorrect&name= zdfgzd&company= zdfbx&email=srtydrt@&phone=dtyyj&country= xdfgbx&notes= xdfbxdfb cgfyj cxfgyjgf xftuc
    was not found on this server

    philbert diceva che il codice mio è privo di senso

    io vorrei solamente che al submit di un form se i campi sono tutti corretti
    scriva nella pagina del form
    grazie, etc
    se i campi non sono corretti scriva un messaggio di errore
    e riscriva nei campi il valore inviato in post
    per evitare che l'utente dopo un errore debba scrivere tutto daccapo

    se l'email non è corretta lo stess
    come si fa questo in php ?? grazie dell'aiuto

  5. #5
    Se il link comincia con "/" devi specificare il path dalla cartella radice del server. Non puoi usare "/http://www....".
    In ogni caso la soluzione migliore sarebbe usare le sessioni per passare le variabili da una pagina al altra.

  6. #6
    grazie ma il codice è questo non c'è lo slash
    perchè risulta sempre con lo slash??
    sto facendo un semplice redirect con parametri
    come si fa un redirect in php???
    così mi da sempre errore

    Not Found

    Codice PHP:
    if (!validEmail($Email))
      {
      
      
    $what3 "http://www.miosito.it/contacts.php?msg=the email is incorrect&name=".$_REQUEST['Name']."&company=".$_REQUEST['Company']."&email=".$_REQUEST['Email']."&phone=".$_REQUEST['Phone']."&country=".$_REQUEST['Country']."&notes=".$_POST['Notes'];
    $what3 trim($what3); 
    $what3 rawurlencode($what3);
    header("Location: $what3"); 
      

       
       }else{
       
       
        
    $what2 "http://www.miosito.it/contacts.php?msg=Please fill the mandatory fields, thank you&name=".$_REQUEST['Name']."&company=".$_REQUEST['Company']."&email=".$_REQUEST['Email']."&phone=".$_REQUEST['Phone']."&country=".$_REQUEST['Country']."&notes=".$_POST['Notes'];
    $what2 trim($what2); 
    $what2 rawurlencode($what2);
    header("Location: $what2"); 


  7. #7
    Prova cosi:
    Codice PHP:
    if (!validEmail($Email))   {
    $what3 "contacts.php?msg=the email is incorrect&name=".$_REQUEST['Name']."&company=".$_REQUEST['Company']."&email=".$_REQUEST['Email']."&phone=".$_REQUEST['Phone']."&country=".$_REQUEST['Country']."&notes=".$_POST['Notes']; 
    $what3 rawurlencode(trim($what3)); 
    header("Location: $what3");
    }else{             
    $what2 "contacts.php?msg=Please fill the mandatory fields, thank you&name=".$_REQUEST['Name']."&company=".$_REQUEST['Company']."&email=".$_REQUEST['Email']."&phone=".$_REQUEST['Phone']."&country=".$_REQUEST['Country']."&notes=".$_POST['Notes'];
    $what2 rawurlencode(trim($what2)); 
    header("Location: $what2");  


  8. #8
    grazie ma con header non ci riesco forse sto risolvendo con javascript e variabili si sessione

    così all'inizio della pagina writecontact.php

    Codice PHP:
     session_start();

     
      
    $_SESSION['input1'] = $_POST['Name']."+".$_POST['Company'] ."+".$_POST['Email'] ."+".$_POST['Phone'] ."+".$_POST['Country'] ."+".$_POST['Notes'] ; 
    poi le leggo così nella pagina contact.php

    <?php echo $_SESSION['input1'];?>

    solo che non le legge non capisco perchè mi dite cosa sbaglio con queste session??

    invece il redirect lo faccio cosi

    Codice PHP:
    if (!validEmail($Email))
      {
      
        ?>
      <script type="text/javascript">
    <!--
    window.location = "http://www.miosito.it/contacts.php?msg=the email is incorrect"
    //-->
    </script>
    <?php

      
      

       
       
    }else{
       
       
         
    ?>
      <script type="text/javascript">
    <!--
    window.location = "http://www.miosito.it/contacts.php?msg=Please fill the mandatory fields, thank you"
    //-->
    </script>
    <?php
    sarà barbarico ma almeno mi sembra che non mi da più errore

    mi date una mano con le session??? grazie dell'aiuto

  9. #9
    risolto dovevo mettere session_destroy();
    prima di ogni lettura della sessione così

    <?php session_start();
    echo $_SESSION['views'];
    ?>

    grazie, ciao

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.