עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

הצגת הודעה בעמוד חדש ב-PHP

Featured Replies

פורסם

שלום,

אני מנסה לבנות עמוד הרשמה, ואני רוצה שכשאחרי שהנתונים ייכנסו למסד נתונים, תוצג הודעה בעמוד חדש המודיעה שההרשמה התבצעה בהצלחה.

איך עושים זאת?

הנה חלק הקוד הרלוונטי:

 // הצבת משתנים מהטופס
$userName = $_POST['username'];
$password = $_POST['password'];
$password2 = $_POST['password2'];
$e_mail = $_POST['e_mail'];

// השוואה
$uname = mysql_query("SELECT * FROM UserDetails WHERE `userName`='$userName'");
$email = mysql_query("SELECT * FROM UserDetails WHERE `e_mail`='$e_mail'");

if(isset($_POST['submit']))
{
if ($userName == '' | $password == '' | $e_mail == '')
$error = "שגיאה: חייב להכניס את כל הנתונים";

elseif ($password <> $password2){
$error = "שגיאה: הסיסמא לא תואמת";
}

elseif (mysql_num_rows($uname) > 0){
$error = "שגיאה: שם המשתמש שבחרת תפוס";
}

elseif (mysql_num_rows($email) > 0){
$error = "שגיאה: כתובת האימייל שמסרת כבר רשומה במערכת";
}

else{
mysql_query("INSERT INTO `UserDetails` (userName,e_mail,password)
VALUES (
'$userName','$e_mail','$password');") or die("ERROR: ".mysql_error());
echo("ההרשמה בוצעה");
}
}

תודה מראש

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.