• User Attivo

    get e post aiuto modifica

    ciao ragazzi ho un problemino...cioè vorrei cambiare una cosa a un file...
    ho uno script che quando uno scrive un messaggio nella barra del link x inviarlo riscrive tutto il testo e se questo è lungo a volte crea problemi...dovrebbe essere la funzione get o post da cambiare...sapete dirmi se vi allego il file dove cambiarla????

    [php]
    <?php

    $title = 'Nuovo topic';
    require 'pmheader.php';

    $sub = (empty($_POST['sub'])) ? "0" : $_POST['sub'];
    $txt = (empty($_POST['txt'])) ? "0" : $_POST['txt'];
    $forum = (empty($_POST['forum'])) ? "-1" : $_POST['forum'];

    echo $header;

    if(!$userdata['session_logged_in'])
    {
    echo "Spiacente devi essere loggato per postare un nuovo topic. Clicca <anchor>Qui!<go href="" . append_sid("waplogin.$phpEx") . "" /></anchor>";
    }

    else if($sub == "0" || $txt == "0" || $forum == "-1")
    {
    ?>
    Oggetto: <input name="sub" type="text" emptyok="false"/><br/>
    Messaggio: <input name="txt" emptyok="false"/><br/>
    Forum: <select name="forum">
    <option value="-1">Scegli il forum</option>
    <?php

    $query = $db->sql_query("select forum_id,forum_name from ". FORUMS_TABLE . " where forum_status = \"0\" order by cat_id ASC");
    $forum = $db->sql_fetchrowset($query);
    foreach ($forum as $val)
    {
    	$auth = auth(AUTH_ALL,$val['forum_id'],$userdata);
    	if($auth['auth_post'])
    	{
    		echo "<option value=\"".$val['forum_id']."\">".htmlentities ($val['forum_name'])."</option>\n";
    	}
    }
    

    ?>
    </select><br/>
    <anchor>
    Invia<br/>
    <go href="<?php echo append_sid("wapnew.$phpEx?sub=$(sub)&txt=$(txt)&forum=$(forum)"); ?>" method="post">
    <postfield name="sub" value="$(sub)"/>
    <postfield name="txt" value="$(txt)"/>
    <postfield name="forum" value="$(forum)"/>
    </go>
    </anchor>
    <?php
    }
    else
    {
    $current_time = time();
    $sql = $db->sql_query("SELECT * FROM " . USERS_TABLE . " WHERE username = '" . str_replace("'", "''", $userdata['username']) . "'");
    $userdata = $db->sql_fetchrow($sql);
    $user_id = $userdata['user_id'];
    if( $userdata['user_level'] != ADMIN && $board_config['board_disable'] )
    {
    echo "Mi spiace ma il forum e'disattivato. Visita il sito web in un' altro momento";
    }
    else {
    $sql = "SELECT forum_status FROM " . FORUMS_TABLE . " WHERE forum_id = "$forum_id"";
    $query = $db->sql_query($sql);
    $forum_status = $db->sql_fetchrow($query);
    $auth = auth(AUTH_ALL,$forum_id,$userdata);
    if ( $forum_status['forum_status'] == FORUM_LOCKED && !$auth['auth_mod'])
    {
    $footer = "<br/><br/><anchor>Forum Home<go href="" . append_sid("wap.$phpEx") . "" /></anchor>".$footer;
    echo "Mi spiace questo forum e' chiuso. Non puoi postare nel topic.";
    die(" ".$footer);
    }
    else
    {
    //Flood Control
    $current_time = time();
    $query = $db->sql_query("SELECT MAX(post_time) AS last_post_time FROM " . POSTS_TABLE . " WHERE poster_id = "$user_id"");
    $flood = $db->sql_fetchrow($query);
    if ( $flood['last_post_time'] > 0 && ( $current_time - $flood['last_post_time'] ) < $board_config['flood_interval'] )
    {
    echo "Non puoi inviare un messaggio subito. Aspetta un po e riprova.";
    }
    else
    {
    $txt = $txt." \n\n<i>Scritto da Nokia Mobile Device</i>";
    $uid = make_bbcode_uid();
    $txt = prepare_wap_post($txt,$uid);
    $time = time();
    $update_topics = $db->sql_query("insert into " . TOPICS_TABLE . " (forum_id, topic_title, topic_poster, topic_time, topic_views, topic_replies, topic_status, topic_vote, topic_type, topic_first_post_id, topic_last_post_id, topic_moved_id) values ("$forum", "$sub", "$user_id", "$time", "0", "0", "0", "0", "0", "0","0", "0")");
    $topic = $db->sql_nextid();
    $update_posts = $db->sql_query("insert into " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig, post_edit_count) values ("$topic","$forum","".$userdata['user_id']."","$time","".$userdata['user_ip']."","0","0","1","$sig","0")");
    $post_id = $db->sql_nextid();
    $update_topics2 = $db->sql_query("update ". TOPICS_TABLE . " set topic_first_post_id = "$post_id", topic_last_post_id = "$post_id" where topic_id = "$topic"");
    $update_text = $db->sql_query("insert into " . POSTS_TEXT_TABLE . " (post_id, bbcode_uid, post_subject, post_text) values ("$post_id", "$uid", "$sub", "$txt")");
    $update_forums = $db->sql_query("update " . FORUMS_TABLE . " set forum_posts=forum_posts+1, forum_last_post_id = $post_id, forum_topics=forum_topics+1 where forum_id = "$forum"");
    $update_user = $db->sql_query("update " . USERS_TABLE . " set user_posts=user_posts+1 where user_id = "$user_id"");
    echo "Clicca <anchor>Qui!<go href="". append_sid("waptopic.$phpEx?topic=$topic&forum=$forum") . "" /></anchor> per vedere il tuo messaggio.";
    }
    }
    }
    }
    echo $footer;
    ?>
    [/php]
    grazie a ki mi saprà aiutare


  • User Attivo

    Ciao hiwap3,
    purtroppo non mi è chiara la domanda... :bho:
    Cos'è la barra del link? Come la si usa per inviare messaggi? Che problema ti crea quando il testo è troppo lungo?

    Dacci maggiori indicazioni e forse riusciremo ad aiutarti!
    :ciauz: