Foros del Web » Programando para Internet » PHP »

Ayuda con formulario, no recivo datos adjuntos pero si las imagenes ¬¬?

Estas en el tema de Ayuda con formulario, no recivo datos adjuntos pero si las imagenes ¬¬? en el foro de PHP en Foros del Web. Tengo este formulario de contacto con opción de upload de archivos, el formulario funciona bien salvo en que solo recivo el Nombre de quien me ...
  #1 (permalink)  
Antiguo 22/06/2007, 13:06
Avatar de xiscomax  
Fecha de Ingreso: febrero-2006
Mensajes: 379
Antigüedad: 18 años, 2 meses
Puntos: 5
Ayuda con formulario, no recivo datos adjuntos pero si las imagenes ¬¬?

Tengo este formulario de contacto con opción de upload de archivos, el formulario funciona bien salvo en que solo recivo el Nombre de quien me manda el formulario, la direccion de correo de esta persona y el archivo adjunto.
Pero no recivo el mensaje escrito.

Tengo 2 versiones del Formulario.

version que no incluye opción de adjuntar archivos y funciona bien, me llegan todos los datos del remitente.

Nombre
Mensaje de texto
Web
Y me muestra incluso la IP


version "Que es la que quiero" si incluye opcion de adjuntar pero no recivo mas que el Nombre y el Archivo adjunto.

Os dejo el codigo de cada una de las versiones empezando por la que funciona. Haber si alguien me puede decir donde puede fallar la 2ª version con upload.

1ª version sin upload
Código PHP:
<?php
/*
Plugin Name: WP-ContactForm (de)
Plugin URI: http://johannesries.de/webwork/contactform/
Description: Das WP-ContactForm Plugin generiert ein Kontaktformular, das in statische Seiten oder Beiträge mittels Quicktag bzw. Button-Klick eingefügt werden kann. (Kompatibel mit WordPress 2.0 und aufwärts) Deutschsprachige Version von <a href="http://johannesries.de">Johannes Ries</a>.
Author: Ryan Duff
Author URI: http://ryanduff.net
Version: 1.4.3
*/

load_plugin_textdomain('wpcf',$path 'wp-content/plugins/wp-contact-form');

/* Declare strings that change depending on input. This also resets them so errors clear on resubmission. */
$wpcf_strings = array(
    
'name' => '<div class="contactright"><input type="text" name="wpcf_your_name" id="wpcf_your_name" size="30" maxlength="50" value="' $_POST['wpcf_your_name'] . '" /> (' __('required''wpcf') . ')</div>',
    
'email' => '<div class="contactright"><input type="text" name="wpcf_email" id="wpcf_email" size="30" maxlength="50" value="' $_POST['wpcf_email'] . '" /> (' __('required''wpcf') . ')</div>',
    
'msg' => '<div class="contactright"><textarea name="wpcf_msg" id="wpcf_msg" cols="35" rows="8" >' $_POST['wpcf_msg'] . '</textarea></div>',
    
'error' => '');

/*
This shows the quicktag on the write pages
Based off Buttonsnap Template
http://redalt.com/downloads
*/
if(get_option('wpcf_show_quicktag') == true) {
    include(
'buttonsnap.php');

    
add_action('init''wpcf_button_init');
    
add_action('marker_css''wpcf_marker_css');

    function 
wpcf_button_init() {
        
$wpcf_button_url buttonsnap_dirname(__FILE__) . '/wpcf_button.png';

        
buttonsnap_textbutton($wpcf_button_url__('Insert Contact Form''wpcf'), '<!--contact form-->');
        
buttonsnap_register_marker('contact form''wpcf_marker');
    }

    function 
wpcf_marker_css() {
        
$wpcf_marker_url buttonsnap_dirname(__FILE__) . '/wpcf_marker.gif';
        echo 
"
            .wpcf_marker {
                    display: block;
                    height: 15px;
                    width: 155px
                    margin-top: 5px;
                    background-image: url({$wpcf_marker_url});
                    background-repeat: no-repeat;
                    background-position: center;
            }
        "
;
    }
}

function 
wpcf_is_malicious($input) {
    
$is_malicious false;
    
$bad_inputs = array("\r""\n""mime-version""content-type""cc:""to:");
    foreach(
$bad_inputs as $bad_input) {
        if(
strpos(strtolower($input), strtolower($bad_input)) !== false) {
            
$is_malicious true; break;
        }
    }
    return 
$is_malicious;
}

/* This function checks for errors on input and changes $wpcf_strings if there are any errors. Shortcircuits if there has not been a submission */
function wpcf_check_input()
{
    if(!(isset(
$_POST['wpcf_stage']))) {return false;} // Shortcircuit.

    
$_POST['wpcf_your_name'] = stripslashes(trim($_POST['wpcf_your_name']));
    
$_POST['wpcf_email'] = stripslashes(trim($_POST['wpcf_email']));
    
$_POST['wpcf_website'] = stripslashes(trim($_POST['wpcf_website']));
    
$_POST['wpcf_msg'] = stripslashes(trim($_POST['wpcf_msg']));

    global 
$wpcf_strings;
    
$ok true;

    if(empty(
$_POST['wpcf_your_name']))
    {
        
$ok false$reason 'empty';
        
$wpcf_strings['name'] = '<div class="contactright"><input type="text" name="wpcf_your_name" id="wpcf_your_name" size="30" maxlength="50" value="' $_POST['wpcf_your_name'] . '" class="contacterror" /> (' __('required''wpcf') . ')</div>';
    }

    if(!
is_email($_POST['wpcf_email']))
    {
        
$ok false$reason 'empty';
        
$wpcf_strings['email'] = '<div class="contactright"><input type="text" name="wpcf_email" id="wpcf_email" size="30" maxlength="50" value="' $_POST['wpcf_email'] . '" class="contacterror" /> (' __('required''wpcf') . ')</div>';
    }

    if(empty(
$_POST['wpcf_msg']))
    {
        
$ok false$reason 'empty';
        
$wpcf_strings['msg'] = '<div class="contactright"><textarea name="wpcf_msg" id="wpcf_message" cols="35" rows="8" class="contacterror">' $_POST['wpcf_msg'] . '</textarea></div>';
    }

    if(
wpcf_is_malicious($_POST['wpcf_your_name']) || wpcf_is_malicious($_POST['wpcf_email'])) {
        
$ok false$reason 'malicious';
    }

    if(
$ok == true)
    {
        return 
true;
    }
    else {
        if(
$reason == 'malicious') {
            
$wpcf_strings['error'] = "<div style='font-weight: bold;'>You can not use any of the following in the Name or Email fields: a linebreak, or the phrases 'mime-version', 'content-type', 'cc:' or 'to:'.</div>";
        } elseif(
$reason == 'empty') {
            
$wpcf_strings['error'] = '<div style="font-weight: bold;">' stripslashes(get_option('wpcf_error_msg')) . '</div>';
        }
        return 
false;
    }
}

/*Wrapper function which calls the form.*/
function wpcf_callback$content )
{
    global 
$wpcf_strings;

    
/* Run the input check. */

        
if(! preg_match('|<!--contact form-->|'$content)) {
        return 
$content;
        }

    if(
wpcf_check_input()) // If the input check returns true (ie. there has been a submission & input is ok)
    
{
            
$recipient get_option('wpcf_email');
            
$subject get_option('wpcf_subject');
                        
$success_msg get_option('wpcf_success_msg');
                        
$success_msg stripslashes($success_msg);

            
$name $_POST['wpcf_your_name'];
            
$email $_POST['wpcf_email'];
            
$website $_POST['wpcf_website'];
            
$msg $_POST['wpcf_msg'];

                  
$headers "MIME-Version: 1.0\n";
                        
$headers .= "From: $name <$email>\n";
                        
$headers .= "Content-Type: text/plain; charset=\"" get_settings('blog_charset') . "\"\n";

            
$fullmsg "$name schrieb:\n";
            
$fullmsg .= wordwrap($msg80"\n") . "\n\n";
            
$fullmsg .= "Website: " $website "\n";
            
$fullmsg .= "IP: " getip();

            
mail($recipient$subject$fullmsg$headers);

            
$results '<div style="font-weight: bold;">' $success_msg '</div>';
            echo 
$results;
    }
    else 
// Else show the form. If there are errors the strings will have updated during running the inputcheck.
    
{
        
$form '<div class="contactform">
        ' 
$wpcf_strings['error'] . '
            <form action="' 
get_permalink() . '" method="post">
                <div class="contactleft"><label for="wpcf_your_name">' 
__('Your Name: ''wpcf') . '</label></div>' $wpcf_strings['name']  . '
                <div class="contactleft"><label for="wpcf_email">' 
__('Your Email:''wpcf') . '</label></div>' $wpcf_strings['email'] . '
                <div class="contactleft"><label for="wpcf_website">' 
__('Your Website:''wpcf') . '</label></div><div class="contactright"><input type="text" name="wpcf_website" id="wpcf_website" size="30" maxlength="100" value="' $_POST['wpcf_website'] . '" /></div>
                <div class="contactleft"><label for="wpcf_msg">' 
__('Your Message: ''wpcf') . '</label></div>' $wpcf_strings['msg'] . '
                <div class="contactright"><input type="submit" name="Submit" value="' 
__('Submit''wpcf') . '" id="contactsubmit" /><input type="hidden" name="wpcf_stage" value="process" /></div>
            </form>
        </div>
        <div style="clear:both; height:1px;">&nbsp;</div>'
;
        return 
str_replace('<!--contact form-->'$form$content);
    }
}


/*Can't use WP's function here, so lets use our own*/
function getip()
{
    if (isset(
$_SERVER))
    {
         if (isset(
$_SERVER["HTTP_X_FORWARDED_FOR"]))
         {
              
$ip_addr $_SERVER["HTTP_X_FORWARDED_FOR"];
         }
         elseif (isset(
$_SERVER["HTTP_CLIENT_IP"]))
         {
              
$ip_addr $_SERVER["HTTP_CLIENT_IP"];
         }
         else
         {
             
$ip_addr $_SERVER["REMOTE_ADDR"];
         }
    }
    else
    {
         if ( 
getenv'HTTP_X_FORWARDED_FOR' ) )
         {
              
$ip_addr getenv'HTTP_X_FORWARDED_FOR' );
         }
         elseif ( 
getenv'HTTP_CLIENT_IP' ) )
         {
              
$ip_addr getenv'HTTP_CLIENT_IP' );
         }
         else
         {
              
$ip_addr getenv'REMOTE_ADDR' );
         }
    }
return 
$ip_addr;
}


/*CSS Styling*/
function wpcf_css()
    {
    
?>
<style type="text/css" media="screen">

/* Wp-Contact Form (de) CSS */
.contactform {
    position: static;
    overflow: hidden;
}

.contactleft {
    width: 25%;
    text-align: right;
    clear: both;
    float: left;
    display: inline;
    padding: 4px;
    margin: 5px 0;
}

.contactright {
    width: 70%;
    text-align: left;
    float: right;
    display: inline;
    padding: 4px;
    margin: 5px 0;
}

.contacterror {
    border: 1px solid #ff0000;
}

.contactsubmit {
}
/* Ende Wp-ContactForm (de) CSS */

    </style>

<?php

    
}

function 
wpcf_add_options_page()
    {
        
add_options_page('Contact Form Options''Contact Form''manage_options''wp-contact-form/options-contactform.php');
    }

/* Action calls for all functions */

//if(get_option('wpcf_show_quicktag') == true) {add_action('admin_footer', 'wpcf_add_quicktag');}

add_action('admin_head''wpcf_add_options_page');
add_filter('wp_head''wpcf_css');
add_filter('the_content''wpcf_callback'7);

?>
En el siguiente post esta la 2ª version

Última edición por xiscomax; 22/06/2007 a las 13:14
  #2 (permalink)  
Antiguo 22/06/2007, 13:11
Avatar de xiscomax  
Fecha de Ingreso: febrero-2006
Mensajes: 379
Antigüedad: 18 años, 2 meses
Puntos: 5
Re: Ayuda con formulario, no recivo datos adjuntos pero si las imagenes ¬¬?

2ª version con upload "ES LA QUE QUIERO CONSEGUIR QUE FUNCIONE"
Es exactamente el mismo script pero con opcion de adjuntar archivos
Código PHP:
<?php
/*
Plugin Name: WP-ContactForm
Plugin URI: http://ryanduff.net/projects/wp-contactform/
Description: WP Contact Form is a drop in form for users to contact you. It can be implemented on a page or a post. It currently works with WordPress 2.0+
Author: Ryan Duff
Author URI: http://ryanduff.net
Version: 1.4.3
*/

load_plugin_textdomain('wpcf',$path 'wp-content/plugins/wp-contact-form');

// Attachments max size in KB!
$attachment_max_size 1024;

/* Declare strings that change depending on input. This also resets them so errors clear on resubmission. */
$wpcf_strings = array(
    
'name' => '<div class="contactright"><input  class="textfield" type="text" name="wpcf_your_name" id="wpcf_your_name" size="30" maxlength="50" value="' $_POST['wpcf_your_name'] . '" /></div>',
    
'email' => '<div class="contactright"><input  class="textfield" type="text" name="wpcf_email" id="wpcf_email" size="30" maxlength="50" value="' $_POST['wpcf_email'] . '" /></div>',
    
'msg' => '<br/><textarea  class="textfield" name="wpcf_msg" id="wpcf_msg" cols="35" rows="8" >' $_POST['wpcf_msg'] . '</textarea>',
    
'error' => '');

/*
This shows the quicktag on the write pages
Based off Buttonsnap Template
http://redalt.com/downloads
*/
if(get_option('wpcf_show_quicktag') == true) {
    include(
'buttonsnap.php');

    
add_action('init''wpcf_button_init');
    
add_action('marker_css''wpcf_marker_css');

    function 
wpcf_button_init() {
        
$wpcf_button_url buttonsnap_dirname(__FILE__) . '/wpcf_button.png';

        
buttonsnap_textbutton($wpcf_button_url__('Insert Contact Form''wpcf'), '<!--contact form-->');
        
buttonsnap_register_marker('contact form''wpcf_marker');
    }

    function 
wpcf_marker_css() {
        
$wpcf_marker_url buttonsnap_dirname(__FILE__) . '/wpcf_marker.gif';
        echo 
"
            .wpcf_marker {
                    display: block;
                    height: 15px;
                    width: 155px
                    margin-top: 5px;
                    background-image: url({$wpcf_marker_url});
                    background-repeat: no-repeat;
                    background-position: center;
            }
        "
;
    }
}

function 
wpcf_is_malicious($input) {
    
$is_malicious false;
    
$bad_inputs = array("\r""\n""mime-version""content-type""cc:""to:");
    foreach(
$bad_inputs as $bad_input) {
        if(
strpos(strtolower($input), strtolower($bad_input)) !== false) {
            
$is_malicious true; break;
        }
    }
    return 
$is_malicious;
}

/* This function checks for errors on input and changes $wpcf_strings if there are any errors. Shortcircuits if there has not been a submission */
function wpcf_check_input()
{
    if(!(isset(
$_POST['wpcf_stage']))) {return false;} // Shortcircuit.

    
$_POST['wpcf_your_name'] = stripslashes(trim($_POST['wpcf_your_name']));
    
$_POST['wpcf_email'] = stripslashes(trim($_POST['wpcf_email']));
    
$_POST['wpcf_website'] = stripslashes(trim($_POST['wpcf_website']));
    
$_POST['wpcf_msg'] = stripslashes(trim($_POST['wpcf_msg']));

    global 
$wpcf_strings;
    
$ok true;

    if(empty(
$_POST['wpcf_your_name']))
    {
        
$ok false$reason 'empty';
        
$wpcf_strings['name'] = '<div class="contactright"><input type="text" name="wpcf_your_name" id="wpcf_your_name" size="30" maxlength="50" value="' $_POST['wpcf_your_name'] . '" class="contacterror" /> (' __('required''wpcf') . ')</div>';
    }

    if(!
is_email($_POST['wpcf_email']))
    {
        
$ok false$reason 'empty';
        
$wpcf_strings['email'] = '<div class="contactright"><input type="text" name="wpcf_email" id="wpcf_email" size="30" maxlength="50" value="' $_POST['wpcf_email'] . '" class="contacterror" /> (' __('required''wpcf') . ')</div>';
    }

    if(empty(
$_POST['wpcf_msg']))
    {
        
$ok false$reason 'empty';
        
$wpcf_strings['msg'] = '<div class="contactright"><textarea name="wpcf_msg" id="wpcf_message" cols="35" rows="8" class="contacterror">' $_POST['wpcf_msg'] . '</textarea></div>';
    }

    if(
wpcf_is_malicious($_POST['wpcf_your_name']) || wpcf_is_malicious($_POST['wpcf_email'])) {
        
$ok false$reason 'malicious';
    }

    if(
$ok == true)
    {
        return 
true;
    }
    else {
        if(
$reason == 'malicious') {
            
$wpcf_strings['error'] = "<div style='font-weight: bold;'>You can not use any of the following in the Name or Email fields: a linebreak, or the phrases 'mime-version', 'content-type', 'cc:' or 'to:'.</div>";
        } elseif(
$reason == 'empty') {
            
$wpcf_strings['error'] = '<div style="font-weight: bold;">' stripslashes(get_option('wpcf_error_msg')) . '</div>';
        }
        return 
false;
    }
}

/*Wrapper function which calls the form.*/
function wpcf_callback$content )
{
    global 
$wpcf_strings$attachment_max_size;

    
/* Run the input check. */

        
if(! preg_match('|<!--contact form-->|'$content)) {
        return 
$content;
        }

    if(
wpcf_check_input()) // If the input check returns true (ie. there has been a submission & input is ok)
    
{
            
$recipient get_option('wpcf_email');
            
$subject get_option('wpcf_subject');
                        
$success_msg get_option('wpcf_success_msg');
                        
$success_msg stripslashes($success_msg);

            
$name $_POST['wpcf_your_name'];
            
$email $_POST['wpcf_email'];
            
$website $_POST['wpcf_website'];
            
$msg $_POST['wpcf_msg'];

        
$regexp "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>";
        if(
preg_match_all("/$regexp/siU"$msg$matchesPREG_SET_ORDER)) {
            if(
count($matches) > 2) {
                
$results '<h2 class="pagetitle red">No more than 2 links allowed!</h2>';
                echo 
$results;
                return;
             }
/*
            foreach($matches as $match) {
            # $match[2] = link address 
            # $match[3] = link text
            }
*/
        
}

        
$headers "MIME-Version: 1.0\n";
        
$headers .= "From: $name <$email>\n";
                        
//$headers .= "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n";

        
$headers .= "Content-Type: multipart/related; type=\"multipart/alternative\"; boundary=\"----=MIME_BOUNDRY_main_message\"\n";
        
$headers .= "X-Sender: $from_name<" $email ">\n";
        
$headers .= "X-Mailer: PHP4\n";
        
$headers .= "X-Priority: 3\n"//1 = Urgent, 3 = Normal
        
$headers .= "Return-Path: <" $email ">\n"
        
$headers .= "This is a multi-part message in MIME format.\n";
        
$headers .= "------=MIME_BOUNDRY_main_message \n"
        
$headers .= "Content-Type: multipart/alternative; boundary=\"----=MIME_BOUNDRY_message_parts\"\n"

            
//$fullmsg = "$name wrote:\n";
            //$fullmsg .= wordwrap($msg, 80, "\n") . "\n\n";
            //$fullmsg .= "Website: " . $website . "\n";
            //$fullmsg .= "IP: " . getip();


$filecount 0;
foreach(
$_FILES as $file => $value) {
    
$attachment[(int)$filecount] = $_FILES[$file]['tmp_name'];
    
$attachment_name[(int)$filecount] = $_FILES[$file]['name'];
    
$attachment_size[(int)$filecount] = $_FILES[$file]['size'];
    if (
is_uploaded_file($attachment[(int)$filecount])) { //Do we have a file uploaded?
        
if ($attachment_size[(int)$filecount] <= $attachment_max_size 1024) { //Do we have a file uploaded?
            
$fp fopen($attachment[(int)$filecount], "rb"); //Open it
            
$data[(int)$filecount] = fread($fpfilesize($attachment[(int)$filecount])); //Read it
            
$data[(int)$filecount] = chunk_split(base64_encode($data[(int)$filecount])); //Chunk it up and encode it as base64 so it can emailed
            
fclose($fp);
            
$filecount++;
        }
    }
}
    
//$attachment = $_FILES['cattachment']['tmp_name'];
//    $attachment_name = $_FILES['cattachment']['name']; 
//    if (is_uploaded_file($attachment)) { //Do we have a file uploaded?
//      $fp = fopen($attachment, "rb"); //Open it
//      $data = fread($fp, filesize($attachment)); //Read it
//      $data = chunk_split(base64_encode($data)); //Chunk it up and encode it as base64 so it can emailed
//        fclose($fp);
//    } 
    
    
$fullmsg "------=MIME_BOUNDRY_message_parts\n";
    
$fullmsg .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n"
    
$fullmsg .= "Content-Transfer-Encoding: quoted-printable\n"
    
$fullmsg .= "\n"
    
/* Add our message, in this case it's plain text.  You could also add HTML by changing the Content-Type to text/html */
    
$fullmsg .= "Website: " $website "\n";
        
$fullmsg .= "$name wrote:\n";
    
$fullmsg .= wordwrap($msg80"\n") . "\n\n";
    
$fullmsg .= "\n"
    
$fullmsg .= "------=MIME_BOUNDRY_message_parts--\n"
    
$fullmsg .= "\n"

        
$fullmsg .= "------=MIME_BOUNDRY_main_message\n"
  
for (
$i 0$filecount = (int) count($data); $i $filecount$i++) {
    
$fullmsg .= "------=MIME_BOUNDRY_main_message\n";
    
$fullmsg .= "Content-Type: application/octet-stream;\n\tname=\"" $attachment_name[$i] . "\"\n";
    
$fullmsg .= "Content-Transfer-Encoding: base64\n";
    
$fullmsg .= "Content-Disposition: attachment;\n\tfilename=\"" $attachment_name[$i] . "\"\n\n";
    
$fullmsg .= $data[$i]; //The base64 encoded message
    
$fullmsg .= "\n\n";
}

      
//$fullmsg .= "Content-Type: application/octet-stream;\n\tname=\"" . $attachment_name . "\"\n";
    //$fullmsg .= "Content-Transfer-Encoding: base64\n";
    //$fullmsg .= "Content-Disposition: attachment;\n\tfilename=\"" . $attachment_name . "\"\n\n";
    //$fullmsg .= $data; //The base64 encoded message
    //$fullmsg .= "\n"; 
    
$fullmsg .= "------=MIME_BOUNDRY_main_message--\n";  

            
mail($recipient$subject$fullmsg$headers);

            
$results '<h2 class="pagetitle">' $success_msg '</h2>';
            echo 
$results;
    }
Continua...PHP.. Sig. Post

Última edición por xiscomax; 22/06/2007 a las 13:16
  #3 (permalink)  
Antiguo 22/06/2007, 13:12
Avatar de xiscomax  
Fecha de Ingreso: febrero-2006
Mensajes: 379
Antigüedad: 18 años, 2 meses
Puntos: 5
Re: Ayuda con formulario, no recivo datos adjuntos pero si las imagenes ¬¬?

Código PHP:
else // Else show the form. If there are errors the strings will have updated during running the inputcheck.
    {
        $form = '<div class="contactform"><h2 align="center">Contact me</h2>
        ' . $wpcf_strings['error'] . '
            <form enctype="multipart/form-data" action="' . get_permalink() . '" method="post">
                <div class="contactleft"><label for="wpcf_your_name">' . __('Your Name (*): ', 'wpcf') . '</label></div>' . $wpcf_strings['name']  . '
                <div class="contactleft"><label for="wpcf_email">' . __('Your Email (*):', 'wpcf') . '</label></div>' . $wpcf_strings['email'] . '
                <div class="contactleft"><label for="wpcf_website">' . __('Your Website:', 'wpcf') . '</label></div><div class="contactright"><input class="textfield" type="text" name="wpcf_website" id="wpcf_website" size="30" maxlength="100" value="' . $_POST['wpcf_website'] . '" /></div>
                <div class="contactleft nop"><label for="wpcf_msg">' . __('Your Message: ', 'wpcf') . '</label>' . $wpcf_strings['msg'] . '</div>
                <div class="contactleft nop"><label for="wpcf_msg">' . __('Attach Photos: ', 'wpcf') . '<small>max ' . $attachment_max_size . ' kb</small></label><br/>
                            <input type="file" name="cattachment1"  class="textfield file" /><br/>
                            <input type="file" name="cattachment2"  class="textfield file" /><br/>
                            <input type="file" name="cattachment3"  class="textfield file" /></div>
                <div class="contactright"><input type="submit" name="Submit" value="Send" id="contactsubmit" /><input type="hidden" name="wpcf_stage" value="process" /></div>
            </form>
        </div>
        <div style="clear:both; height:1px;">&nbsp;</div>';
        return str_replace('<!--contact form-->', $form, $content);
    }
}


/*Can't use WP's function here, so lets use our own*/
function getip()
{
    if (isset($_SERVER))
    {
         if (isset($_SERVER["HTTP_X_FORWARDED_FOR"]))
         {
              $ip_addr = $_SERVER["HTTP_X_FORWARDED_FOR"];
         }
         elseif (isset($_SERVER["HTTP_CLIENT_IP"]))
         {
              $ip_addr = $_SERVER["HTTP_CLIENT_IP"];
         }
         else
         {
             $ip_addr = $_SERVER["REMOTE_ADDR"];
         }
    }
    else
    {
         if ( getenv( 'HTTP_X_FORWARDED_FOR' ) )
         {
              $ip_addr = getenv( 'HTTP_X_FORWARDED_FOR' );
         }
         elseif ( getenv( 'HTTP_CLIENT_IP' ) )
         {
              $ip_addr = getenv( 'HTTP_CLIENT_IP' );
         }
         else
         {
              $ip_addr = getenv( 'REMOTE_ADDR' );
         }
    }
return $ip_addr;
}


/*CSS Styling*/
function wpcf_css()    {
    ?>
<?php

    
}

function 
wpcf_add_options_page()
    {
        
add_options_page('Contact Form Options''Contact Form''manage_options''wp-contact-form/options-contactform.php');
    }

/* Action calls for all functions */

//if(get_option('wpcf_show_quicktag') == true) {add_action('admin_footer', 'wpcf_add_quicktag');}

add_action('admin_head''wpcf_add_options_page');
add_filter('wp_head''wpcf_css');
add_filter('the_content''wpcf_callback'7);

?>
Haber si alguien ve que es lo que esta fallando.
Gracias y salu2
  #4 (permalink)  
Antiguo 22/06/2007, 15:47
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 11 meses
Puntos: 2135
Re: Ayuda con formulario, no recivo datos adjuntos pero si las imagenes ¬¬?

Que error es el que te lanza?

Saludos.
  #5 (permalink)  
Antiguo 22/06/2007, 16:34
Avatar de xiscomax  
Fecha de Ingreso: febrero-2006
Mensajes: 379
Antigüedad: 18 años, 2 meses
Puntos: 5
Re: Ayuda con formulario, no recivo datos adjuntos pero si las imagenes ¬¬?

GatorV Ya lo tengo arreglado, resulta que quien modifico el script añadiendole la opción upload dejo bugs xD y eh encontrado una version corregida del plugin xD Gracias
Pues no lanzava ningun error simplemente no enviaba el texto.
Salu2
Tema arreglado se agradece.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 05:34.