|
Pièces portable
Batterie
Bluetooth
Cable LCD
Caddie
Carte graphique
Carte mere
Carte reseau
Carte wifi
Chargeur
Charniere - Fixation
Clavier
Connecteur AC
Coque - Plasturgie
Disque dur
Ecran - Dalle LCD
Enceintes
Inverter
Lecteur - Graveur
Memoire / RAM
Modem
Nappe
Pcmcia
Pile cmos
Processeur
Radiateur
Touchpad
Ventilateur
Webcam
Divers |
Pages: 1
probleme pour inserer une fonction dans une page pour deux champsbonjour a tous Code:function verification($row) { $row = strtr( $row,"àáâãäåòóôõöøèéêëçìíîïùúûüÿñÀÁÂÃÄÅÒÓÔÕÖØÈÉÊËÇÌÍÎÏÙÚÛÜÑ","aaaaaaooooooeeeeciiiiuuuuynAAAAAAOOOOOOEEEECIIIIUUUUN"); $row = strtr($row," ","_"); $row = str_replace("'","_",$row); $row = str_replace("\"","_",$row); $row = str_replace("&","",$row); $row = str_replace("(","",$row); $row = str_replace(")","",$row); $row = str_replace("[","",$row); $row = str_replace("]","",$row); $row = str_replace(":","",$row); $row = str_replace("<","",$row); $row = str_replace(">","",$row); $row = str_replace("\\","",$row); $row = str_replace("/","",$row); $row = str_replace("*","",$row); $row = str_replace("?","",$row); $row = str_replace("’","",$row); $row = str_replace("«","",$row); $row = str_replace("»","",$row); $row = str_replace("~","",$row); $row = str_replace("|","",$row); $row = str_replace("`","",$row); $row = str_replace("^","",$row); $row = str_replace("°","",$row); $row = str_replace("=","",$row); $row = str_replace("+","",$row); $row = str_replace("-","",$row); $row = str_replace("¨","",$row); $row = str_replace("$","",$row); $row = str_replace("£","",$row); $row = str_replace("¤","",$row); $row = str_replace("%","",$row); $row = str_replace("µ","",$row); $row = str_replace("§","",$row); $row = str_replace("!","",$row); $row = str_replace(";","",$row); $row = str_replace(".","",$row); $row = str_replace(",","",$row); $row = str_replace("@","",$row); $row = str_replace("²","2",$row); $row = str_replace(" "," ",$row); return($row); } je ne sais pas comment et ou l inserer j ai fais des essais à Code:<?php require_once("../../class2.php"); if (!getperms("P")) { header("location:".e_BASE."index.php"); } require_once(e_ADMIN."auth.php"); if (file_exists(e_PLUGIN."atoll/language/".e_LANGUAGE.".php")){ require_once(e_PLUGIN."atoll/language/".e_LANGUAGE.".php"); } $debug = false; $configtitle = ATOLL_ADMIN_00; $atolltable = "atoll"; $categorytable = "atoll_category"; $primaryid = "id"; // first column of your table. $e_wysiwyg = ""; // commas seperated list of textareas to use wysiwyg with. $pageid = "media"; // unique name that matches the one used in admin_menu.php. $show_preset = FALSE; // allow e107 presets to be saved for use in the form. $fieldcapt[] = ATOLL_ADMIN_MEDIA_00_0; $fieldname[] = "title"; $fieldtype[] = "text"; $fieldvalu[] = ",96%,100"; $fieldmand[] = "*"; $fieldcapt[] = ATOLL_ADMIN_MEDIA_01_0; $fieldname[] = "description"; $fieldtype[] = "textarea"; $fieldvalu[] = ",96%,500px"; $fieldmand[] = ""; $fieldcapt[] = ATOLL_ADMIN_MEDIA_09_0; $fieldname[] = "author"; $fieldtype[] = "text"; $fieldvalu[] = USERNAME.",50,100"; $fieldmand[] = ""; //--------------------------------------------------------------- // END OF CONFIGURATION AREA //--------------------------------------------------------------- // -------- Presets. ------------ // always load before auth.php if ($show_preset) { require_once(e_HANDLER."preset_class.php"); $pst = new e_preset; $pst->form = "adminform"; // form id of the form that will have it's values saved. $pst->page = e_SELF; // display preset options on which page(s). $pst->id = "admin_".$atolltable; } require_once(e_ADMIN."auth.php"); require_once("form_handler.php"); $rs = new form; // Validation checks /////////////////////////////////////////////////////////////////// if (isset($_POST['add']) || isset($_POST['update'])) { if (strlen($_POST['title']) == 0) { $message .= "Title ".ATOLL_ADMIN_MEDIA_12; } } // Data is valid so try and add ///////////////////////////////////////////////////////// if (!isset($message) && isset($_POST['add'])) { if ($debug) print "<br>".print_r($_POST)."<br>"; $count = count($fieldname); for ($i=0; $i<$count; $i++) { $inputstr .= " '".$rs->getfieldvalue($fieldname[$i], $fieldtype[$i], $debug)."', "; } $inputstr .= time(); if ($sql->db_Insert($atolltable, "0, $inputstr", $debug)) { $message = ATOLL_ADMIN_MEDIA_06; unset($_POST['add']); } else { $message = ATOLL_ADMIN_MEDIA_07; } } // Data is valid so try and update /////////////////////////////////////////////////////// if (!isset($message) && isset($_POST['update'])) { if ($debug) print "<br>".print_r($_POST)."<br>"; $count = count($fieldname); for ($i=0; $i<$count; $i++) { $inputstr .= $fieldname[$i]."='".$rs->getfieldvalue($fieldname[$i], $fieldtype[$i], $debug)."', "; } $inputstr .= "timestamp=".time(); if ($sql->db_Update($atolltable, "$inputstr WHERE $primaryid='".$_POST[$primaryid]."'", $debug)) { $message = ATOLL_ADMIN_MEDIA_04; unset($_POST['update']); } else { if ($debug) print "<br>".mysql_error()."<br>"; $message = ATOLL_ADMIN_MEDIA_05; } } //$fieldname // Get details from DB if Edit, otherwise set from POST data if (isset($_POST['edit'])) { $sql -> db_Select($atolltable, "*", " $primaryid='".$_POST['existing']."' "); $row = $sql->db_Fetch(); } else { if (isset($_POST['add']) || isset($_POST['update'])) { $row = $_POST; } } // Try the delete if (isset($_POST['delete'])) { if ($debug) print "<br>".print_r($_POST)."<br>"; $message = ($sql -> db_Delete($atolltable, "$primaryid='".$_POST['existing']."' ")) ? ATOLL_ADMIN_MEDIA_08 : ATOLL_ADMIN_MEDIA_09; } // Draw the form $text = "<div style='text-align:center'><form method='post' action='".e_SELF."' id='myexistingform'> <table style='width:96%;margin-left:auto;margin-right:auto;' class='fborder'>"; if (isset($message)) { $text .= "<tr><td colspan='2' class='spacer' style='text-align:center'>$message</td></tr>"; if ($debug) print "<br>".mysql_error()."<br>"; } $text .= "<tr><td colspan='2' class='forumheader' style='text-align:center'>"; $table_total = $sql->db_Select($atolltable, "*", " order by id asc", ""); if (!$table_total) { $text .= ATOLL_ADMIN_MEDIA_10; } else { $text .= "<span class='defaulttext'>".ATOLL_ADMIN_MEDIA_00.":</span><select name='existing' class='tbox'>"; while (list($id, $title, $description, $rest) = $sql-> db_Fetch()) { $sql2->db_Select($atolltable, "*", "id=$id order by id"); list($id, $title, $description, $rest) = $sql2->db_Fetch(); $text .= "<option value='$id'>$title ($id)</option>"; } $text .= "</select><input class='button' type='submit' name='edit' value='".ATOLL_ADMIN_MEDIA_01."' /> <input class='button' type='submit' name='delete' value='".ATOLL_ADMIN_MEDIA_11."' /></td></tr>"; } $text .= "</table></form></div>"; $text .= "<div style='text-align:center'>\n"; $text .= "<form method='post' action='".e_SELF."' id='adminform'><table class='fborder' style='margin-left:auto;margin-right:auto;width:96%'>"; for ($i=0; $i<count($fieldcapt); $i++) { $form_send = $fieldcapt[$i] . "|" .$fieldtype[$i]."|".$fieldvalu[$i]; $text .="<tr> <td style='vertical-align:top' class='forumheader3'>".$fieldcapt[$i]." ".$fieldmand[$i]."</td> <td class='forumheader3'>"; $text .= $rs->user_extended_element_edit($form_send, $row[$fieldname[$i]], $fieldname[$i]); $text .="</td></tr>"; }; $text .= "<tr style='vertical-align:top'><td colspan='2' style='text-align:center' class='forumheader'>"; if (isset($_POST['edit']) || isset($_POST['update'])){ $text .= "<input class='button' type='submit' id='update' name='update' value='".ATOLL_ADMIN_MEDIA_02."' /> <input type='hidden' name='$primaryid' value='".$row[$primaryid]."'>"; } else { $text .= "<input class='button' type='submit' id='add' name='add' value='".ATOLL_ADMIN_MEDIA_03."' />"; } $text .= "</td></tr></table></form></div>"; $ns->tablerender($configtitle, $text); require_once(e_ADMIN."footer.php"); ?>
Re: probleme pour inserer une fonction dans une page pour deux champsBonjour,
Re: probleme pour inserer une fonction dans une page pour deux champsje suis content pour votre post
Re: probleme pour inserer une fonction dans une page pour deux champsun autre petit message d'aide . pour le message de Guest-83 Pages: 1
Réponse rapide|==> Faire un lien vers ce sujet ??<a href="http://www.brakstar.com/forum/braktopic_8945.html" title="probleme pour inserer une fonction dans une page pour deux champs">probleme pour inserer une fonction dans une page pour deux champs</a> | ||||||||||||||||||
| |||||||||||||||||||