30-08-2008, 15:42
|
|
|
חבר מתאריך: 11.03.07
הודעות: 6
|
|
צריך עזרה במערכת guestbook
אני לא בטוח אם הבעיה היא בphp או בפלאש אבל הנה:
יש לי אתר בפלאש שיש בו שני דברים שעובדים עם php
1- טופס "צור קשר" יש 2 שדות שממלאים ואז לוחצים על כפתור וזה שולח לאימייל שמוגדר מראש בתוך הphp
2- מערכת guestbook יש 3 שדות שממלאים
לוחצים על "שלח" זה מריץ קובץ php שבעצם שומר את הנתונים שנשלחו מהפלאש בקובץtxt
ואז הפלאש מציג את הקובץ txt
הכל עובד מצוין חוץ מהעברית
נתחיל קודם מהguestbook
מה שקורה עם העברית זה שפשוט במקום העברית לא מופיע כלום
נגיד שבשדה name הכנסתי "בדיקה"
מופיע לי name:
וזהו....
זה הקוד php
קוד PHP:
<?php // If you are using an old version of php, remove the next set of lines. // or use $HTTP_POST_VARS["..."] instead. $Submit = [CODE]%4$s[/CODE] POST["Submit"]; $Name = [CODE]%4$s[/CODE] POST["Name"]; $Email = [CODE]%4$s[/CODE] POST["Email"]; $Comments = [CODE]%4$s[/CODE] POST["Comments"]; $NumLow = [CODE]%4$s[/CODE] REQUEST["NumLow"]; $NumHigh = [CODE]%4$s[/CODE] REQUEST["NumHigh"]; // Replace special characters - you can remove the next 5 lines if wanted. $Name = ereg_replace("[^A-Za-z0-9 ]", "", $Name); $Email = ereg_replace("[^A-Za-z0-9 \@\.\-\/\']", "", $Email); $Comments = ereg_replace("[^A-Za-z0-9 \@\.\-\/\']", "", $Comments); // Remove slashes. $Name = stripslashes($Name); $Email = stripslashes($Email); $Comments = stripslashes($Comments); // ################################################## ########## ####################### // ########## Reading and Writing the new data to the GuestBook Database ############# if ($Submit == "Yes") { // Next line tells the script which Text file to open. $filename = "GuestBook.txt"; // Opens up the file declared above for reading $fp = fopen( $filename,"r"); $OldData = fread($fp, 80000); fclose( $fp ); // Gets the current Date of when the entry was submitted $Today = (date ("l dS of F Y ( h:i:s A )",time())); // Puts the recently added data into html format that can be read into the Flash Movie. // You can change this up and add additional html formating to this area. For a complete listing of all html tags // you can use in flash - visit: [url]http://www.macromedia.com/support/flash/ts/documents/htmltex[/url] t.htm $Input = "name: <b>$Name</b><br>email: <b><u><a href=\" mailto:$Email\">$Email</a></u></b><b r><b>$Comments</b><br><i><font size=\"-1\">date: $Today</font><br><br>.:::."; /* This Line adds the '&GuestBook=' part to the front of the data that is stored in the text file. This is important because without this the Flash movie would not be able to assign the variable 'GuestBook' to the value that is located in this text file */ $New = "$Input$OldData"; // Opens and writes the file. $fp = fopen( $filename,"w"); if(!$fp) die("&GuestBook=cannot write $filename ......&"); fwrite($fp, $New, 800000); fclose( $fp ); } // ################################################## ########## ####################### // ######### Formatting and Printing the Data from the Guestbook to the Flash Movie ## // Next line tells the script which Text file to open. $filename = "GuestBook.txt"; // Opens up the file declared above for reading $fp = fopen( $filename,"r"); $Data = fread($fp, 800000); fclose( $fp ); // Splits the Old data into an array anytime it finds the pattern .:::. $DataArray = split (".:::.", $Data); // Counts the Number of entries in the GuestBook $NumEntries = count($DataArray) - 1; print "&TotalEntries=$NumEntries&NumLow=$NumLow&NumHig h=$NumHigh&GuestBook="; for ($n = $NumLow; $n < $NumHigh; $n++) { print $DataArray[$n]; if (!$DataArray[$n]) { Print "<br><br><b>No More entries</b>"; exit; } } ?>
אני צריך שהקוד יתמוך בעברית וגם יציג הכל בעברית לדוגמא:
שם:בדיקה
דוא"ל:בדיקה
הערות:בדיקה
כשניסיתי לשנות רק את התצוגה לעברית הפלאש לא הסכים לטען את הtxt בכלל
באנגלית הכל עובד מצוין
נערך לאחרונה ע"י Poke בתאריך 30-08-2008 בשעה 15:45.
|