Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem to edit a page
#1
Hi everyone

First of all, thank you for your reply to my question. I now have another problem. I tried to edit and save a page, but when I try to save something on a page (changedata.php) the page goes blank. Any ideas? It's not a permissions issue. I have 777 recursive to folders, backups and data.

Any ideas ?

Thanks in advance
Reply
#2
If you’re editting a page and the page was not previously created there on that server the page’s data file might have a permission problem.

Are you able to create new pages?

Does the screen go blank when saving or is it just that you lose data? If the screen goes blank you might want to enable debug mode and check for errors. You might want to do that anyway when editing a page to see whether GetSimple gives us any pointers as to where to look for the problem.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#3
Just discovered, I have this same problem.

Editing existing pages throws up /admin/changedata.php as a blank page after pressing save.

The page saves, but I am not returned to the edit.


Debug mode says this:

Code:
Warning: Cannot modify header information - headers already sent by (output started at /homepages/23/d79985469/htdocs/website/plugins/contact_form.php:1) in /homepages/23/d79985469/htdocs/website/admin/inc/cookie_functions.php on line 26

Warning: Cannot modify header information - headers already sent by (output started at /homepages/23/d79985469/htdocs/website/plugins/contact_form.php:1) in /homepages/23/d79985469/htdocs/website/admin/changedata.php on line 178

Any help much appreciated
Reply
#4
it looks to be a problem with the contact_form.php plugin. Can you remove that plugin from your site and see if the problem goes away?
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#5
Hi Chris,

Yes - the problem goes when the plugin is removed.

I really need the plugin to be installed though - do you have any idea what would be causing the errors?

Many thanks

Code:
<?php
/*
Name: Simple Cumbe contact form
Description: Pues eso es un formulario de contacto simple
Version: 4.0
Author: Cumbe
Author URI: http://
*/

// Relative
$relative = '../';
$path = $relative. 'data/other/';

# get correct id for plugin
$thisfile=basename(__FILE__, ".php");

# register plugin
register_plugin(
    $thisfile,
    'Cumbe_contact',
    '3.0',
    'Cumbe',
    'http://',
    'Description:  Getsimple contactform',
    'plugins', //page type
    'vermensajes'
);

//set internationalization
                //$VIEWMESSAGE = 'Ver mensajes recibidos';
                $VIEWMESSAGE = 'View contactform.log';

//añadimos a sidebar de pestaña plugins
add_action('plugins-sidebar','createSideMenu',array('contact_form',$VIEWMESSAGE));

////////////////////////////////////////////////
////////////////////////////////////////////////
////////////////////////////////////////////////

function vermensajes(){
global $i18n;

$log_name = 'contactform.log';
$log_path = GSDATAOTHERPATH.'logs/';
$log_file = $log_path . $log_name;

if(file_exists($log_file)) {
    $log_data = getXML($log_file);
    if (@$_GET['action'] == 'delete' && strlen($log_name)>0) {
        unlink($log_file);
        exec_action('logfile_delete');
?>
        <label>Log <?php echo $log_name;?> <?php echo $i18n['MSG_HAS_BEEN_CLR']; ?>            
                </div>
        </div>
        <div id="sidebar" >
            <?php include('template/sidebar-plugins.php'); ?>
        </div>    
        <div class="clear"></div>
        </div>
        <?php get_template('footer'); ?>
<?php
                exit;
    }
?>

            <label><?php echo $i18n['VIEWING'];?>&nbsp;<?php echo $i18n['LOG_FILE'];?>: &lsquo;<em><?php echo @$log_name; ?></em>&rsquo;</label>
            <div class="edit-nav" >
                <a href="load.php?id=contact_form&action=delete" accesskey="c" title="<?php echo $i18n['CLEAR_ALL_DATA'];?> <?php echo $log_name; ?>?" /><?php echo $i18n['CLEAR_THIS_LOG'];?></a>
                <div class="clear"></div>
            </div>
            <ol class="more" >
                <?php
                $count = 1;

                foreach ($log_data as $log) {
                    echo '<li><p style="font-size:11px;line-height:15px;" ><b style="line-height:20px;" >'.$i18n['LOG_FILE_ENTRY'].'</b><br />';
                    foreach($log->children() as $child) {
                      $name = $child->getName();
                      echo '<b>'. stripslashes(ucwords($name)) .'</b>: ';
                      
                      $d = $log->$name;
                      $n = strtolower($child->getName());
                      $ip_regex = '/^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:[.](?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$/';
                      $url_regex = @"((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)";
                      
                      
                      //check if its an url address
                      if (do_reg($d, $url_regex)) {
                          $d = '<a href="'. $d .'" target="_blank" >'.$d.'</a>';
                      }
                      
                      //check if its an ip address
                      if (do_reg($d, $ip_regex)) {
                          if ($d == $_SERVER['REMOTE_ADDR']) {
                              $d = $i18n['THIS_COMPUTER'].' (<a href="http://www.geobytes.com/IpLocator.htm?GetLocation&IpAddress='. $d.'" target="_blank" >'.$d.'</a>)';
                          } else {
                              $d = '<a href="http://www.geobytes.com/IpLocator.htm?GetLocation&IpAddress='. $d.'" target="_blank" >'.$d.'</a>';
                          }
                      }
                      
                      //check if its an email address
                      if (check_email_address($d)) {
                          $d = '<a href="mailto:'.$d.'">'.$d.'</a>';
                      }
                      
                      //check if its a date
                      if ($n === 'date') {
                          $d = lngDate($d);
                      }
                          
                      echo stripslashes($d);
                      echo ' <br />';
                    }
                    echo "</p></li>";
                    $count++;
                }                
                
                ?>
            </ol>
        
<?php
}
else{   //If file does not exist
?>
            <label><?php echo $i18n['MISSING_FILE']; ?>: &lsquo;<em><?php echo @$log_name; ?></em>&rsquo;</label>
<?php
}

}

////////////////////////////////////////////////
////////////////////////////////////////////////
////////////////////////////////////////////////

function set_contact_page() {
global $EMAIL;
global $SITEURL;

if (file_exists('gsconfig.php')) {
    include_once('gsconfig.php');
}

// Debugging
if (defined('GSDEBUG')){
    error_reporting(E_ALL | E_STRICT);
    ini_set('display_errors', 1);
} else {
    error_reporting(0);
    @ini_set('display_errors', 0);
}
    
    $err = '';
    
if (file_exists(GSDATAOTHERPATH.'website.xml')) {
        $dataw = getXML(GSDATAOTHERPATH.'website.xml');
        $TIMEZONE = $dataw->TIMEZONE;
}

        //Set Internationalization  
        //Traducción al español. Descomentar las siguientes líneas y comentar la traducción al inglés
        /*        
        $MSG_CONTACTERR = 'Hubo un error enviando su correo electrónico';
                $MSG_CAPTCHA_FAILED = 'Fallo en el Captcha, creemos que usted puede ser un robot de spam';
        $CONTACT_FORM_SUB = 'Envío de Formulario de Contacto';
        $WHO = 'de';
        $MSG_CONTACTSUC = 'Su mensaje ha sido enviado, gracias.';
        */
        
        //Translate to english                
        $MSG_CAPTCHA_FAILED = 'Captcha failed, please try again';
        $CONTACT_FORM_SUB = 'Contact Form Submission';
        $WHO = 'from';
               $MSG_CONTACTSUC = 'Your message has been sent';
        $MSG_CONTACTERR = 'There was an error sending your email';
                

        //translate words show in page
        $Nb = 'Name:&nbsp;';    //Name
        $Em = 'Email:&nbsp;';
        $Tm = 'Subject:&nbsp;';      //Subject, Tema
        $Ms = 'Message:';   //Message
        $Ev = 'Send message'; //Send message    


    if( function_exists('date_default_timezone_set') ) {
        date_default_timezone_set(@$TIMEZONE);
    }
    
    if (file_exists(GSDATAOTHERPATH.'user.xml')) {
        $data = getXML(GSDATAOTHERPATH.'user.xml');
        $EMAIL = $data->EMAIL;
    }
    
    if (isset($_POST['contact-submit'])) {


              $pot = file_get_contents(GSDATAUPLOADPATH.'string.txt');
             if ( $pot == strtolower($_POST['contact']['pot']) ) {
                  $captcha = $_POST['contact']['pot'];
             }
             else {
              $err .= "\n". $MSG_CAPTCHA_FAILED;
         }

         if ( $_POST['contact']['email'] != '' ) {
            $from = $_POST['contact']['email'];
        } else {
            $from = 'no-reply@get-simple.info';
         }          

         if ( $_POST['contact']['tema'] != '' ) {
            $subject = $_POST['contact']['tema'];
        } else {
            $subject = $CONTACT_FORM_SUB;
         }

        if ($err == '' && trim($_POST['contact']['email']) !='' && trim($_POST['contact']['Mensaje']) !='') {

            $server_name = getenv ("SERVER_NAME");       // Server Name
            $request_uri = getenv ("REQUEST_URI");       // Requested URI

            $headers = "From: ".$from."\r\n";
            $headers .= "Return-Path: ".$from."\r\n";
            $headers .= "Content-type: text/html\r\n";

            $temp = $_POST['contact'];
            $captcha = $_POST['contact']['pot'];

            unset($temp['pot']);
            unset($temp['contact-submit']);
            unset($temp['submit']);

            $body = $CONTACT_FORM_SUB.' '.$WHO.' http://'.$server_name.$request_uri.' <br />';
            $body .= "-----------------------------------<br /><br />";

            $xmlfile = "data/other/logs/contactform.log";
            if ( ! file_exists($xmlfile) ) {
                            $xml = new SimpleXMLExtended('<channel></channel>');
            } else
            {
                $xmldata = file_get_contents($xmlfile);
                        $xml = new SimpleXMLExtended($xmldata);
            }

            $thislog = $xml->addChild('entry');
            $thislog->addChild('date', date('r'));
            $cdata = $thislog->addChild('from');
            $cdata->addCData($from);
            $cdata = $thislog->addChild('subject');
            $cdata->addCData(htmlentities($subject, ENT_QUOTES, 'UTF-8'));
            $cdata = $thislog->addChild('captcha');
            $cdata->addCData($captcha);
            $cdata = $thislog->addChild('ip_address');
            $ip = getenv("REMOTE_ADDR");
            $cdata->addCData(htmlentities($ip, ENT_QUOTES, 'UTF-8'));
            $body .= "Ip: ". $ip ."<br />";
            foreach ( $temp as $key => $value ) {
                $body .= ucfirst($key) .": ". $value ."<br />";
                $cdata = $thislog->addChild(clean_url($key));
                $cdata->addCData(htmlentities($value, ENT_QUOTES, 'UTF-8'));
            }
            $result = mail($EMAIL,$subject,$body,$headers);

            XMLsave($xml, $xmlfile);

            //results
            if ($result=='1') {
                echo '<p class="contactmsg success">'.$MSG_CONTACTSUC.'<br /><br /></p>';
            } else {
                echo '<p class="contactmsg error">'.$MSG_CONTACTERR.'</p>';
            }
        } else {
             if (trim($err) !=''){
            echo '<p class="contactmsg error">'.$err.'.<br />Captcha code: '.$pot.'<br / >Code wrote: '.$_POST['contact']['pot'].'</p>';
             }
                 else {
                     echo '<font color="red">*** Required fields empty ***</font>';
             }
        }

    }


//Show in page  
?>    
        <form action="index.php?id=<?php get_page_slug(); ?>" method="post">
            <p style="margin-bottom: 6px;"><label><?php echo $Nb; ?><br />
          </label><input style="margin-left:2px; width: 400px;" type="text" class="text" name="contact[nombre]" /></p>
            <p style="margin-bottom: 6px;">
          <label><?php echo $Em; ?><br />
          </label><input style="margin-left:2px; width: 400px;" type="text" class="text" name="contact[email]" /></p>
                        <p style="margin-bottom: 6px;"><label><?php echo $Tm; ?><br />
          </label><input style="margin-left:2px; width: 400px;" type="text" class="text" name="contact[tema]" cols="60" /></p>
            <p style="margin-bottom: 6px;">
              <label><?php echo $Ms; ?></label><br /><textarea class="text" name="contact[Mensaje]" rows="7" cols="70"></textarea></p>
            <p>
              <label>CAPTCHA Code:</label>
                        <br />
                        <?php imgCtf_cp(); ?>
                        <img src= "<?php echo $SITEURL; ?>data/uploads/string.png" />
                        <br />
                        <input class="text" type="text" style="width: 130px; " value="" name="contact[pot]" />
            </p>
        
            <p><input type="submit" class="submit" value="<?php echo $Ev; ?>" id="contact-submit" name="contact-submit" /></p>  
               </form>
<?php
}
function imgCtf_cp(){
    function randomText($length) {
        $key = '';
        $cadena = "123456789ABCDEFGHIJKLMNPQRSTUVWXYZ";
        for($i=0;$i<$length;$i++) {
          $key .= $cadena{rand(0,33)}.' ';
        }
        return $key;
         }

    $pot = randomText(4);
        $im = imagecreate(105, 30);
        // Colors
        $rojo = imagecolorallocate($im, 151, 151, 151);
    $blanco = imagecolorallocate($im, 255, 255, 255);
        $gris = imagecolorallocate($im, 128, 128, 128);
        $negro = imagecolorallocate($im, 0, 0, 0);
        // Dibujar la imagen
    imagefilledrectangle($im, 0, 0, 164, 29, $rojo);
        imagestring($im,  6, 20, 11, $pot, $negro);
    imagestring($im,  6, 16, 5, $pot, $blanco);

    //if you want to difficult more the captcha discomment the next line.
        //imageline($im, 10, 25, 155, 25, $blanco);
        // Guardar la imagen
        imagepng($im, GSDATAUPLOADPATH.'string.png');
        imagedestroy($im);
        //guardar el texto
        $str_txt = fopen(GSDATAUPLOADPATH.'string.txt', 'w');
        fwrite($str_txt, str_replace(' ','',trim(strtolower($pot))));
        fclose ($str_txt);
    }


?>
Reply
#6
Hi James;
I tested with the code that you have posted and I have not had any problems.

What version are you using of Getsimple?.

Regards
Reply
#7
With the plugin without modify, do you have any error?
Reply
#8
Strange. I just went back to the unmodified plugin, then modded one part at a time and now it works.

Thanks for your help.

I wonder if there is anything different in the code now:

Code:
<?php
/*
Name: Simple Cumbe contact form
Description: Pues eso es un formulario de contacto simple
Version: 4.0
Author: Cumbe
Author URI: http://
*/

// Relative
$relative = '../';
$path = $relative. 'data/other/';

# get correct id for plugin
$thisfile=basename(__FILE__, ".php");

# register plugin
register_plugin(
    $thisfile,
    'Cumbe_contact',
    '3.0',
    'Cumbe',
    'http://',
    'Description:  Getsimple contactform',
    'plugins', //page type
    'vermensajes'
);

//set internationalization
                //$VIEWMESSAGE = 'Ver mensajes recibidos';
                $VIEWMESSAGE = 'View contactform.log';

//añadimos a sidebar de pestaña plugins
add_action('plugins-sidebar','createSideMenu',array('contact_form',$VIEWMESSAGE));

////////////////////////////////////////////////
////////////////////////////////////////////////
////////////////////////////////////////////////

function vermensajes(){
global $i18n;

$log_name = 'contactform.log';
$log_path = GSDATAOTHERPATH.'logs/';
$log_file = $log_path . $log_name;

if(file_exists($log_file)) {
    $log_data = getXML($log_file);
    if (@$_GET['action'] == 'delete' && strlen($log_name)>0) {
        unlink($log_file);
        exec_action('logfile_delete');
?>
        <label>Log <?php echo $log_name;?> <?php echo $i18n['MSG_HAS_BEEN_CLR']; ?>            
                </div>
        </div>
        <div id="sidebar" >
            <?php include('template/sidebar-plugins.php'); ?>
        </div>    
        <div class="clear"></div>
        </div>
        <?php get_template('footer'); ?>
<?php
                exit;
    }
?>

            <label><?php echo $i18n['VIEWING'];?>&nbsp;<?php echo $i18n['LOG_FILE'];?>: &lsquo;<em><?php echo @$log_name; ?></em>&rsquo;</label>
            <div class="edit-nav" >
                <a href="load.php?id=contact_form&action=delete" accesskey="c" title="<?php echo $i18n['CLEAR_ALL_DATA'];?> <?php echo $log_name; ?>?" /><?php echo $i18n['CLEAR_THIS_LOG'];?></a>
                <div class="clear"></div>
            </div>
            <ol class="more" >
                <?php
                $count = 1;

                foreach ($log_data as $log) {
                    echo '<li><p style="font-size:11px;line-height:15px;" ><b style="line-height:20px;" >'.$i18n['LOG_FILE_ENTRY'].'</b><br />';
                    foreach($log->children() as $child) {
                      $name = $child->getName();
                      echo '<b>'. stripslashes(ucwords($name)) .'</b>: ';
                      
                      $d = $log->$name;
                      $n = strtolower($child->getName());
                      $ip_regex = '/^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:[.](?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$/';
                      $url_regex = @"((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)";
                      
                      
                      //check if its an url address
                      if (do_reg($d, $url_regex)) {
                          $d = '<a href="'. $d .'" target="_blank" >'.$d.'</a>';
                      }
                      
                      //check if its an ip address
                      if (do_reg($d, $ip_regex)) {
                          if ($d == $_SERVER['REMOTE_ADDR']) {
                              $d = $i18n['THIS_COMPUTER'].' (<a href="http://www.geobytes.com/IpLocator.htm?GetLocation&IpAddress='. $d.'" target="_blank" >'.$d.'</a>)';
                          } else {
                              $d = '<a href="http://www.geobytes.com/IpLocator.htm?GetLocation&IpAddress='. $d.'" target="_blank" >'.$d.'</a>';
                          }
                      }
                      
                      //check if its an email address
                      if (check_email_address($d)) {
                          $d = '<a href="mailto:'.$d.'">'.$d.'</a>';
                      }
                      
                      //check if its a date
                      if ($n === 'date') {
                          $d = lngDate($d);
                      }
                          
                      echo stripslashes($d);
                      echo ' <br />';
                    }
                    echo "</p></li>";
                    $count++;
                }                
                
                ?>
            </ol>
        
<?php
}
else{   //If file does not exist
?>
            <label><?php echo $i18n['MISSING_FILE']; ?>: &lsquo;<em><?php echo @$log_name; ?></em>&rsquo;</label>
<?php
}

}

////////////////////////////////////////////////
////////////////////////////////////////////////
////////////////////////////////////////////////

function set_contact_page() {
global $EMAIL;
global $SITEURL;

if (file_exists('gsconfig.php')) {
    include_once('gsconfig.php');
}

// Debugging
if (defined('GSDEBUG')){
    error_reporting(E_ALL | E_STRICT);
    ini_set('display_errors', 1);
} else {
    error_reporting(0);
    @ini_set('display_errors', 0);
}
    
    $err = '';
    
if (file_exists(GSDATAOTHERPATH.'website.xml')) {
        $dataw = getXML(GSDATAOTHERPATH.'website.xml');
        $TIMEZONE = $dataw->TIMEZONE;
}

        //Set Internationalization  
        //Traducción al español. Descomentar las siguientes líneas y comentar la traducción al inglés
        /*        
        $MSG_CONTACTERR = 'Hubo un error enviando su correo electrónico';
                $MSG_CAPTCHA_FAILED = 'Fallo en el Captcha, creemos que usted puede ser un robot de spam';
        $CONTACT_FORM_SUB = 'Envío de Formulario de Contacto';
        $WHO = 'de';
        $MSG_CONTACTSUC = 'Su mensaje ha sido enviado, gracias.';
        */
        
        //Translate to english                
        $MSG_CAPTCHA_FAILED = 'Captcha failed, we think you are a spam bot';
        $CONTACT_FORM_SUB = 'Contact Form Submission';
        $WHO = 'from';
               $MSG_CONTACTSUC = 'Your email has successfully been sent, thank you.';
        $MSG_CONTACTERR = 'There was an error sending your message. Please check your details';
                

        //translate words show in page
        $Nb = 'Name:&nbsp;';    //Name
        $Em = 'Email:&nbsp;';
        $Tm = 'Subject:&nbsp;';      //Subject, Tema
        $Ms = 'Message:';   //Message
        $Ev = 'Send message'; //Send message    


    if( function_exists('date_default_timezone_set') ) {
        date_default_timezone_set(@$TIMEZONE);
    }
    
    if (file_exists(GSDATAOTHERPATH.'user.xml')) {
        $data = getXML(GSDATAOTHERPATH.'user.xml');
        $EMAIL = $data->EMAIL;
    }
    
    if (isset($_POST['contact-submit'])) {


              $pot = file_get_contents(GSDATAUPLOADPATH.'string.txt');
             if ( $pot == strtolower($_POST['contact']['pot']) ) {
                  $captcha = $_POST['contact']['pot'];
             }
             else {
              $err .= "\n". $MSG_CAPTCHA_FAILED;
         }

         if ( $_POST['contact']['email'] != '' ) {
            $from = $_POST['contact']['email'];
        } else {
            $from = 'no-reply@get-simple.info';
         }          

         if ( $_POST['contact']['tema'] != '' ) {
            $subject = $_POST['contact']['tema'];
        } else {
            $subject = $CONTACT_FORM_SUB;
         }

        if ($err == '' && trim($_POST['contact']['email']) !='' && trim($_POST['contact']['Mensaje']) !='') {

            $server_name = getenv ("SERVER_NAME");       // Server Name
            $request_uri = getenv ("REQUEST_URI");       // Requested URI

            $headers = "From: ".$from."\r\n";
            $headers .= "Return-Path: ".$from."\r\n";
            $headers .= "Content-type: text/html\r\n";

            $temp = $_POST['contact'];
            $captcha = $_POST['contact']['pot'];

            unset($temp['pot']);
            unset($temp['contact-submit']);
            unset($temp['submit']);

            $body = $CONTACT_FORM_SUB.' '.$WHO.' http://'.$server_name.$request_uri.' <br />';
            $body .= "-----------------------------------<br /><br />";

            $xmlfile = "data/other/logs/contactform.log";
            if ( ! file_exists($xmlfile) ) {
                            $xml = new SimpleXMLExtended('<channel></channel>');
            } else
            {
                $xmldata = file_get_contents($xmlfile);
                        $xml = new SimpleXMLExtended($xmldata);
            }

            $thislog = $xml->addChild('entry');
            $thislog->addChild('date', date('r'));
            $cdata = $thislog->addChild('from');
            $cdata->addCData($from);
            $cdata = $thislog->addChild('subject');
            $cdata->addCData(htmlentities($subject, ENT_QUOTES, 'UTF-8'));
            $cdata = $thislog->addChild('captcha');
            $cdata->addCData($captcha);
            $cdata = $thislog->addChild('ip_address');
            $ip = getenv("REMOTE_ADDR");
            $cdata->addCData(htmlentities($ip, ENT_QUOTES, 'UTF-8'));
            $body .= "Ip: ". $ip ."<br />";
            foreach ( $temp as $key => $value ) {
                $body .= ucfirst($key) .": ". $value ."<br />";
                $cdata = $thislog->addChild(clean_url($key));
                $cdata->addCData(htmlentities($value, ENT_QUOTES, 'UTF-8'));
            }
            $result = mail($EMAIL,$subject,$body,$headers);

            XMLsave($xml, $xmlfile);

//results
            if ($result=='1') {
                echo '<p class="contactmsg success">'.$MSG_CONTACTSUC.'<br /><br /></p>';
            } else {
                echo '<p class="contactmsg error">'.$MSG_CONTACTERR.'</p>';
            }
        } else {
             if (trim($err) !=''){
            echo '<p class="contactmsg error">'.$err.'.<br />Captcha code: '.$pot.'<br / >Code wrote: '.$_POST['contact']['pot'].'</p>';
             }
                 else {
                    echo '<font color="red">*** Required fields empty ***</font>';
             }
        }

    }


//Show in page  
?>    
        <form action="index.php?id=<?php get_page_slug(); ?>" method="post">
            <p style="margin-bottom: 6px;"><label><?php echo $Nb; ?></label>
              <br />
        <input style="margin-left:2px; width: 400px;" type="text" class="text" name="contact[nombre]" /></p>
            <p style="margin-bottom: 6px;">
          <label><?php echo $Em; ?><br />
</label><input style="margin-left:2px; width: 400px;" type="text" class="text" name="contact[email]" /></p>
                        <p style="margin-bottom: 6px;"><label><?php echo $Tm; ?><br />
        </label><input style="margin-left:2px; width: 400px;" type="text" class="text" name="contact[tema]" cols="60" /></p>
            <p style="margin-bottom: 6px;">
          <label><?php echo $Ms; ?><br />
        </label><br /><textarea class="text" name="contact[Mensaje]" rows="7" cols="70"></textarea></p>
            <p><label>CAPTCHA Code</label>
            :
                        <br />
                        <?php imgCtf_cp(); ?>
                        <img src= "<?php echo $SITEURL; ?>data/uploads/string.png" /><br />
<input class="text" type="text" style="width: 130px;" value="" name="contact[pot]" />
            </p>
            <p><input type="submit" class="submit" value="<?php echo $Ev; ?>" id="contact-submit" name="contact-submit" /></p>  
               </form>
<?php
}
function imgCtf_cp(){
    function randomText($length) {
        $key = '';
        $cadena = "123456789ABCDEFGHIJKLMNPQRSTUVWXYZ";
        for($i=0;$i<$length;$i++) {
          $key .= $cadena{rand(0,33)}.' ';
        }
        return $key;
         }

    $pot = randomText(4);
        $im = imagecreate(100, 30);
        // Colors
        $rojo = imagecolorallocate($im, 131, 131, 131);
    $blanco = imagecolorallocate($im, 255, 255, 255);
        $gris = imagecolorallocate($im, 128, 128, 128);
        $negro = imagecolorallocate($im, 0, 0, 0);
        // Dibujar la imagen
    imagefilledrectangle($im, 0, 0, 164, 29, $rojo);
        imagestring($im,  6, 20, 11, $pot, $negro);
    imagestring($im,  6, 16, 5, $pot, $blanco);
    //if you want to difficult more the captcha discomment the next line.
        //imageline($im, 10, 25, 155, 25, $blanco);
        // Guardar la imagen
        imagepng($im, GSDATAUPLOADPATH.'string.png');
        imagedestroy($im);
        //guardar el texto
        $str_txt = fopen(GSDATAUPLOADPATH.'string.txt', 'w');
        fwrite($str_txt, str_replace(' ','',trim(strtolower($pot))));
        fclose ($str_txt);
    }


?>
Reply
#9
you do three tests.
SAve the plugin with ANSI and test is you have a error.

SAve the plugin with UTF8 and test is you have a error.

SAve the plugin with UTF8-without BOM and test is you have a error.

REgards.
Reply
#10
I just experienced a really weird glitch with this problem myself. If I edited the contact_form.php file within it's original extraction location and uploaded via my ftp client then the page editing worked fine; however, if I moved the file to another folder, edited it and then uploaded it . . . . I ended up with the blank changedata.php page when I updated a page edit!!!

Now that doesn't make any sense . . . does it?

Too much lemon drizzle cake has gone to my head I think, I guess I've od'ed on lemons!! LOL
Reply
#11
buffff, I get lost in the void!! Smile.

Yes, there is no sense...

Regards
Reply
#12
The same bug - blank screen on page edit.
Haven't investigated, but looks like some encoding problems.

(Without contact.php works fine.)
Reply
#13
fulnestio Wrote:The same bug - blank screen on page edit.
Please enable debug mode to show errors.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#14
Page name (title) MUST be in english or
you must add permanent link (open properties) in english
also parmanent if you use friendly URL don't use "_" in "permanent link" use "-" instead
Reply




Users browsing this thread: 3 Guest(s)