הרשם שאלות ותשובות רשימת חברים לוח שנה הודעות מהיום

חזור   הוסטס - פורום אחסון האתרים הגדול בישראל > עיצוב גראפי, תכנות על כל שפותיו וקידום ושיווק אתרים > פורום תיכנות

   
|!|

השב
 
כלים לאשכול תצורת הצגה
ישן 28-02-08, 19:09   # 1
Labs
חבר וותיק
 
מיני פרופיל
תאריך הצטרפות: Nov 2007
גיל: 33
הודעות: 1,500
Send a message via Skype™ to Labs

Labs לא מחובר  

PHP | Preg_replace

יש לי את השגיאה הבאה:
Warning: preg_replace() [function.preg-replace]: Empty regular expression in /home/content/l/a/d/ladart/html/admin/config.php on line 24

על הביטוי הבא:
PHP קוד:
$name=preg_replace(" ""_"$name); 
הנמצא בפונ'
PHP קוד:
function space($name)
{
$name=preg_replace(" ""_"$name);
return 
$name;

מטרת הפונ' להפוך רווחים ל _
  Reply With Quote
ישן 28-02-08, 19:16   # 2
daMn
הוסטסניון
 
מיני פרופיל
תאריך הצטרפות: Mar 2007
גיל: 34
הודעות: 2,050

daMn לא מחובר  

str_replace
__________________
"חינוך למדעי המחשב לא יכול להפוך אף אחד למתכנת מומחה יותר מאשר לימוד על מברשות וצבעים יכול להפוך מישהו לצייר מיומן."
(אריק ס. ריימונד)
  Reply With Quote
ישן 28-02-08, 19:28   # 3
Labs
חבר וותיק
 
מיני פרופיל
תאריך הצטרפות: Nov 2007
גיל: 33
הודעות: 1,500
Send a message via Skype™ to Labs

Labs לא מחובר  

ציטוט:
נכתב במקור על ידי daMn צפה בהודעה
str_replace
אחלה תודה

עוד בעיה><

PHP קוד:
case "add2":
$name=$_POST['name'];
$name=space($name);
$year=$_POST['year'];
$tech=$_POST['tech'];
$gid=$_POST['gid'];
//upload pics
$file_ext_allow = array("gif","jpg","jpeg","png","JPG","JPEG","GIF","PNG");
$dottt=".";
// ראשי
$file_name = $HTTP_POST_FILES['mainpic']['name'];
ECHO $file_name;
if ($file_name!="") {
$msiu=getlast($file_name);
$new_file_name=$name.$dottt.$msiu;
$path= "../pics/".$new_file_name;
for($i=0;$i<count($file_ext_allow);$i++)
        {
            if (getlast($file_name)!=$file_ext_allow[$i])
                $test.="~~";
        }
$exp=explode("~~",$test);
        if (count($exp)!=(count($file_ext_allow)+1))
        {
if(copy($HTTP_POST_FILES['mainpic']['tmp_name'], $path))
{
// end upload pics
//num id
$numid = mysql_query("select * from `pics`"); 
$numid = mysql_num_rows($numid);
if ($numid=="") {
$id=1;
} else {
$y=0;
for ($ii=1;$ii<=$numid;$ii++) {
$nuum = mysql_query("select * from `pics` WHERE `id`= '$ii'"); 
$nuum = mysql_num_rows($nuum);
if ($nuum=="") {
$id=$ii;
$ii=999999999999;
$y=1;
}
}
if ($y==0) {
$id=$numid+1;
}
}
// end num id
$add = "INSERT INTO pics (id, name, gid, year, tech, pic) VALUES ('$id', '$name', '$gid', '$year', '$tech', '$msiu')";
mysql_query($add);
$succ="התמונה הוספה בהצלחה";
} else {
$succ="בעיה בהעלאת התמונה";
}
} else {
$succ="סיומת אסורה";
}
} else {
$succ="חובה לבחור תמונה";
}
case "add":
?>
    <div class="content">
        <span class="title">הוספת תמונה</span>
        <div class="cont">
<?=$succ?>
<form method="post" enctype="multipart/form-data" id="regf" action="pics.php?a=add2">
<table width="100%">
<tr><td width="120">שם :</td><td><input type="text" name="name" style="width: 400px;" dir="ltr" value="" /></td></tr>
<tr><td width="120">גלריה :</td><td>
<select name="gid" style="width: 400px;">
<option selected="selected" value="0">דריה לבקובסקי</option>
</select>
</td></tr>
<tr><td width="120">טכניקה :</td><td><input type="text" name="tech" style="width: 400px;" dir="ltr" value="Oil" /></td></tr>
<tr><td width="120">שנת יצירה :</td><td><input type="text" name="year" style="width: 400px;" dir="ltr" value="" /></td></tr>
<tr><td width="120">תמונה :</td><td><input type="file" name="mainpic" style="width: 400px;" /></td></tr>
</table>
<br />
<input type="submit" name="submit" value="סע >>" class="butt" />
</form>
הוא תמיד מציג לי שצריך לבחור תמונה
יש לך אולי מושג מה הבעיה שלו?
  Reply With Quote
השב

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 


חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 17:44.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ