@yosafizak כתב בעזרה html.:
@613-0 כתב בעזרה html.:
@בוס אם לא התקדמת איתו, גם @121244 בנה כזה דבר פה.
אתה יכול להשתמש בזה:
| <!DOCTYPE html> |
| <html lang="he"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <title>פרטי יצירת קשר</title> |
| <style> |
| body { |
| text-align: center; |
| font-family: Arial, sans-serif; |
| } |
| header { |
| background-color: #f0f0f0; |
| padding: 10px; |
| } |
| h1 { |
| margin: 0; |
| } |
| form { |
| max-width: 400px; |
| margin: 0 auto; |
| padding: 20px; |
| border: 1px solid #ccc; |
| border-radius: 5px; |
| } |
| label { |
| display: block; |
| text-align: right; |
| margin-top: 10px; |
| } |
| input[type="text"], |
| textarea { |
| width: 100%; |
| padding: 8px; |
| border: 1px solid #ccc; |
| border-radius: 5px; |
| resize: vertical; |
| } |
| button { |
| background-color: #4CAF50; |
| color: white; |
| padding: 10px 20px; |
| border: none; |
| border-radius: 5px; |
| cursor: pointer; |
| margin-top: 10px; |
| } |
| button:hover { |
| background-color: #45a049; |
| } |
| </style> |
| </head> |
| <body> |
| <header> |
| <h1>שם החברה</h1> |
| </header> |
| <form> |
| <label for="name">שם מלא:</label> |
| <input type="text" id="name" name="name" required> |
| |
| <label for="email">כתובת דוא"ל:</label> |
| <input type="text" id="email" name="email" required> |
| |
| <label for="subject">נושא הפנייה:</label> |
| <input type="text" id="subject" name="subject" required> |
| |
| <label for="message">הודעה:</label> |
| <textarea id="message" name="message" rows="6" required> |
דרך אגב, אם אתה באמת רוצה לקבל את הנתונים מהטופס הזה פשוט תוסיף את הקוד הבא וזה ישלח את הנתונים לקובץ contact_data.txt (אם אין כזה קובץ זה יוצר אותו, רק תבדוק שיש לדף הרשאות לעריכת קבצים בשרת)
קוד:
| <?php |
| if ($_SERVER["REQUEST_METHOD"] === "POST") { |
| |
| $name = $_POST["name"] ?? ""; |
| $email = $_POST["email"] ?? ""; |
| $subject = $_POST["subject"] ?? ""; |
| $message = $_POST["message"] ?? ""; |
| |
| |
| $data = "שם: " . $name . "\nכתובת דוא\"ל: " . $email . "\nנושא הפנייה: " . $subject . "\nהודעה: " . $message . "\n\n"; |
| file_put_contents("contact_data.txt", $data, FILE_APPEND); |
| echo "<p>הטופס נשלח בהצלחה!</p>"; |
| } |
| ?> |