הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   בעיה בטופס הזמנה - לא רגיל..חייב עזרה. (https://hosts.co.il/forums/showthread.php?t=16656)

Gal Shafrir 25-02-06 20:59

בעיה בטופס הזמנה - לא רגיל..חייב עזרה.
 
הקוד:
PHP קוד:

<?php
if($Mode == 'Send')
{
if(empty(
$_POST['name']) || empty($_POST['mail']) || empty($_POST['yp']))
{
echo 
"
<form action='?Mode=Send' method='post'>
<center><table id="
Table_01" width="745" height="325" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td colspan="
3">
            <img src="
images/order_01.jpg" width="745" height="74" alt=""></td>
    </tr>
    <tr>
        <td rowspan="
6">
            <img src="
images/order_02.jpg" width="301" height="251" alt=""></td>
        <td width="
156" height="27"><input name='name' value='.$_POST['name'].' style='width:156px;height:25px;' class='input' dir="rtl"></td>
        <td rowspan="
6">
            <img src="
images/order_04.jpg" width="288" height="251" alt=""></td>
    </tr>
    <tr>
        <td>
            <img src="
images/order_05.jpg" width="156" height="19" alt=""></td>
    </tr>
    <tr>
        <td width="
156" height="27"><input name='mail' value='.$_POST['mail'].' style='width:156px;height:25px;' class='input' dir="rtl"></td>
    </tr>
    <tr>
        <td>
            <img src="
images/order_07.jpg" width="156" height="22" alt=""></td>
    </tr>
    <tr>
        <td width="
156" height="51"><textarea name='yp' style='width:156px;height:49px' class='input' dir="rtl">".$_POST['yp']."</textarea></td>
    </tr>
    <tr>
        <td>
            <img src="
images/order_09.jpg" width="156" height="105" alt=""></td>
    </tr>
</table></center></from> 
"
;

יש עוד המשך...אבל זה החלק של הבעיה.

הבעיה:
PHP קוד:

Parse errorparse errorunexpected T_STRINGexpecting ',' or ';' in /home/djgs/domains/djgs.webix.co.il/public_html/order2.php on line 19 

מה לתקן? אני חייב עזרה אני לא יודע למה זה ככה...
ותודה לקוצ'י פוצ'י על חלק מהקוד...

Alter 25-02-06 21:05

תנסה את זה..

PHP קוד:

?php
if($Mode == 'Send')
{
if(empty(
$_POST['name']) || empty($_POST['mail']) || empty($_POST['yp']))
{
echo 
"
<form action='?Mode=Send' method='post'>
<center><table id='Table_01' width='745' height='325' border='0' cellpadding='0' cellspacing='0'>
    <tr>
        <td colspan='3'>
            <img src='images/order_01.jpg' width='745' height='74' alt=''></td>
    </tr>
    <tr>
        <td rowspan='6'>
            <img src='images/order_02.jpg' width='301' height='251' alt=''></td>
        <td width='156' height='27'><input name='name' value='"
.$_POST['name']."' style='width:156px;height:25px;' class='input' dir='rtl'></td>
        <td rowspan='6'>
            <img src='images/order_04.jpg' width='288' height='251' alt=''></td>
    </tr>
    <tr>
        <td>
            <img src='images/order_05.jpg' width='156' height='19' alt=''></td>
    </tr>
    <tr>
        <td width='156' height='27'><input name='mail' value='"
.$_POST['mail']."' style='width:156px;height:25px;' class='input' dir='rtl'></td>
    </tr>
    <tr>
        <td>
            <img src='images/order_07.jpg' width='156' height='22' alt=''></td>
    </tr>
    <tr>
        <td width='156' height='51'><textarea name='yp' style='width:156px;height:49px' class='input' dir='rtl'>'.$_POST['yp'].'</textarea></td>
    </tr>
    <tr>
        <td>
            <img src='images/order_09.jpg' width='156' height='105' alt=''></td>
    </tr>
</table></center></from> 
'; 


שקד 25-02-06 21:08

שים לב שכל הגרשיים שלך בטופס עוצרים את הגרשיים של ה echo כדי שתחזור קצת על החומר
echo

Alon.R 25-02-06 21:17

במקום לעשות echo אתה פשוט יכול לסגור את הסקריפט php (?>) לשים את כל הקטע של הhtml ואז לפתוח שוב את הסקריפט php ככה:

PHP קוד:

<?php 
if($Mode == 'Send'

if(empty(
$_POST['name']) || empty($_POST['mail']) || empty($_POST['yp'])) 

 
?>
<form action='?Mode=Send' method='post'> 
<center><table id='Table_01' width='745' height='325' border='0' cellpadding='0' cellspacing='0'> 
    <tr> 
        <td colspan='3'> 
            <img src='images/order_01.jpg' width='745' height='74' alt=''></td> 
    </tr> 
    <tr> 
        <td rowspan='6'> 
            <img src='images/order_02.jpg' width='301' height='251' alt=''></td> 
        <td width='156' height='27'><input name='name' value='".$_POST['name']."' style='width:156px;height:25px;' class='input' dir='rtl'></td> 
        <td rowspan='6'> 
            <img src='images/order_04.jpg' width='288' height='251' alt=''></td> 
    </tr> 
    <tr> 
        <td> 
            <img src='images/order_05.jpg' width='156' height='19' alt=''></td> 
    </tr> 
    <tr> 
        <td width='156' height='27'><input name='mail' value='".$_POST['mail']."' style='width:156px;height:25px;' class='input' dir='rtl'></td> 
    </tr> 
    <tr> 
        <td> 
            <img src='images/order_07.jpg' width='156' height='22' alt=''></td> 
    </tr> 
    <tr> 
        <td width='156' height='51'><textarea name='yp' style='width:156px;height:49px' class='input' dir='rtl'>'.$_POST['yp'].'</textarea></td> 
    </tr> 
    <tr> 
        <td> 
            <img src='images/order_09.jpg' width='156' height='105' alt=''></td> 
    </tr> 
</table></center></from>  
<?
}


Gal Shafrir 25-02-06 21:18

...
 
אני לא ממש יודע לקרוא אנגלית בכזה רמה כי אני צעיר בכמה שנים ממך.
אממ אתה יכול להגיד לי מה לעשות בנידון ?

KaMiKaZy 25-02-06 21:21

תשנה את הEN לHE בכתובת שהוא הביא לך |קורץ|

Alon.R 25-02-06 21:29

תראה, פעולת echo נכתבת בצורה הזאת:
echo "xxxxxxx";
ברגע שאתה שם ערך (ה'xxxxxx') עם גרשיים הוא עוצר את הפעולה של הecho ואין אחרי זה ; ככה שזה יוצר תקלה.

לכן, כשאתה רוצה להשתמש בecho ויש לך ערך עם גרשיים אתה שם לפני כל גרש \, זאת אומרת, לדוגמה:

echo "<a href="index.html">blalbla</a>"; - קוד לא נכון.
echo "<a href=\"index.html\">blabla</a>"; - קוד נכון.

במקרה שלך, אתה לא צריך להכניס את הטופס בתוך echo, אתה יכול כמו שאמרתי לסגור את הקוד php לכתוב את הקוד html ואז לפתוח שוב את הקוד php אבל כמובן שהקוד html יהיה בתוך מבנה הבקרה, לדוגמא:
if(התנאי)
}
<?
קוד html
<?
}
?>

Gal Shafrir 25-02-06 21:36

אוקיי הסתדרתי...עכשיו עוד כמה שאלות :
איך הופכים תמונה לכפתור שליחה, ולמה זה מלא רווחים:
http://djgs.webix.co.il/order2

Alon.R 25-02-06 21:43

<input name="Submit" type="image" src="your_img">

Gal Shafrir 25-02-06 22:14

אוקיי הסתדרתי..עכשיו יש לי בעיה בקידוד:
http://djgs.webix.co.il/order2 תעשו שליחה ותראו, וגם שזה שולח לאימייל זה ככה.
למה? יכול להיות שזה קשור לזה:
ציטוט:

//tell e-mail client this e-mail contains//alternate versions
$headers .= "Content-Type: multipart/alternative" .
"; boundary = $boundary\r\n\r\n";



//HTML version of message
$headers .= "--$boundary\r\n" .
"Content-Type: text/html; charset=WINDOWS-1255\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";

OldMega 26-02-06 01:22

אתה מגדיר מה שישלח לך לאימייל, כניראה לא הגדרתה טוב תעבור על זה.

Kuchi 26-02-06 02:56

תודה על חלק מהקוד חחח עשיתי לך הכל :X
יש לו בעיה הוא כתב גם באינפוטים במקום value הוא כתב vaule
הכל גם ב TEXTAREA הקוד נתתי לך אותו מוכן והכל שלם ועבד !
רק הייתה בעיה אחת דביקשתי ממך באייסיקיו לא להציף אבל המשיך אז נאלצתי לאגנר הלכתי שניה לשניה ! הוא שלח 35 הודעות באלוהים !
בכל מקרה הקוד שעשיתי לו

PHP קוד:

<html dir="rtl">
    <head>  
                    <title> הזמנת עיצוב </title>  
                <style type="text/css"> 
                    .links {color: #4d4d4d; font-size: 12px; font-weight:bold;font-family:arial; text-decoration: none; }
                    .links:Hover {color: #e1e1e1; font-size: 12px; font-weight: bold;font-family:arial; text-decoration: none; }
                    .text {color: #4d4d4d; font-size: 12px; font-weight: bold;font-family:arial; text-decoration: none; } 
                    .text2 {color: #000000; font-size: 13px; font-weight: bold;font-family:arial; text-decoration: none; }
                </style>
    </head> 
<body bgcolor="#ffffff">
<?php
if($Mode == 'Send')
{
if(empty(
$_POST['name']) || empty($_POST['mail']) || empty($_POST['yp']))
{
echo 
"
<form action='?Mode=Send' method='post'><p align='center'><font class='text2'>שמך המלא:</font>
    <input name='name' value='"
.$_POST['name']."' style='width:200px;' class='text'><br>   
        <br>
            <font class='text2'>האימייל שלך:</font>
                <input name='mail' value='"
.$_POST['mail']."' style='width:200px;' class='text'> 
                    <br>
                        <br>
                    <font class='text2'>בקשה לעיצוב:</font>
                <textarea name='yp' style='width:200px;' class='text'>"
.$_POST['yp']."</textarea>    
            <br>
        <br>
    <input type='submit' name='submit' value='שלח' class='text2'>  
</from> "
;
}
else
    {
echo 
"
<center>
ההודעה נשלחה בהצלחה
</center>
"
;
$name $_POST['name'];
$mail $_POST['mail'];
$yp $_POST['yp'];
//add From: header
$header $_SERVER["SERVER_NAME"];
$headers "From: Admin@$header\r\n";
$NewAdminMail "tnt007@013.net";
//specify MIME version 1.0
$headers .= "MIME-Version: 1.0\r\n";

//unique boundary
$boundary uniqid("HTMLKuchi.be");

//tell e-mail client this e-mail contains//alternate versions
$headers .= "Content-Type: multipart/alternative" .
   
"; boundary = $boundary\r\n\r\n";



//HTML version of message
$headers .= "--$boundary\r\n" .
   
"Content-Type: text/html; charset=WINDOWS-1255\r\n" .
   
"Content-Transfer-Encoding: base64\r\n\r\n";

$text "
<html dir='rtl'>
    <head>  
                    <title> הזמנת עיצוב </title>  
                <style type='text/css'> 
                    .links {color: #4d4d4d; font-size: 12px; font-weight:bold;font-family:arial; text-decoration: none; }
                    .links:Hover {color: #e1e1e1; font-size: 12px; font-weight: bold;font-family:arial; text-decoration: none; }
                    .text {color: #4d4d4d; font-size: 12px; font-weight: bold;font-family:arial; text-decoration: none; } 
                    .text2 {color: #000000; font-size: 13px; font-weight: bold;font-family:arial; text-decoration: none; }
                </style>
    </head> 
<body bgcolor='#ffffff'>
שם השולח : $name
<br>
אימייל השולח : $mail
<br>
בקשת העיצוב : $yp
"
;
$headers .= chunk_split(base64_encode($text));

//send message
mail($NewAdminMail"הזמנת עיצוב"""$headers);
    }
}
else
    {
echo 
"
<form action='?Mode=Send' method='post'><p align='center'><font class='text2'>שמך המלא:</font>
    <input name='name' value='' style='width:200px;' class='text'><br>   
        <br>
            <font class='text2'>האימייל שלך:</font>
                <input name='mail' value='' style='width:200px;' class='text'> 
                    <br>
                        <br>
                    <font class='text2'>בקשה לעיצוב:</font>
                <textarea name='yp' style='width:200px;' class='text'></textarea>    
            <br>
        <br>
    <input type='submit' name='submit' value='שלח' class='text2'>  
</from> "
;
    }

?>

הקוד שלו היה

PHP קוד:

<html dir="rtl">
<head>
<title> הזמנת עיצוב </title>  
<style type="text/css"> 
.links {color: #4d4d4d; font-size: 12px; font-weight:bold;font-family:arial; text-decoration: none; }
.links:Hover {color: #e1e1e1; font-size: 12px; font-weight: bold;font-family:arial; text-decoration: none; }
.text {color: #4d4d4d; font-size: 12px; font-weight: bold;font-family:arial; text-decoration: none; } 
.text2 {color: #000000; font-size: 13px; font-weight: bold;font-family:arial; text-decoration: none; }
</style>
</head> 
<body bgcolor="#ffffff">
<from action="?Go=Send" method="post"><p align="center"><font class="text2">שמך המלא:</font>
<input type="text" name="yname" vaule="" style="width:200px;" class="text"><br>   
<br><font class="text2">האימייל שלך:</font>
<input type="text" name="yemail" vaule="" style="width:200px;" class="text"> <br><br>
<font class="text2">בקשה לעיצוב:</font>
<textarea type="text" name="yp" vaule="" style="width:200px;" class="text"></textarea>    
<br><br><input type="submit" name="send_b" vuale="שלח" class="text2">  
</from> 
<?php 
$to 
"djgs@djgs.webix.co.il,djgs@walla.com"
$body $_POST['yp'] && $_POST['yname'] && $_POST['yemail']; 
$from "from : my site"
$subject "יש לך הודעה חדשה"

if(
$_POST['sned_b']==posted) { 
if (
$_POST['yname'] == "" || $_POST['yemail']=="" || $_POST['yp']=="" ) { 
echo 
"יש פרטים שלא מלאו"
} else { 
mail($to,$subject,$body,$from?>



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

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