Jump to content
php.lv forumi

register in popup


ziedinjsh

Recommended Posts

Sveiki! Vēlos uztaisīt rģistrēšanos iekš popup. It kā esmu uztaisījis jau, bet ir tāda lieta, ka reģistrējas neparādas nekādi uzraksti.. tie ir redzami pēc tam kad atkāroti atver popup. Laikam sanāk taisīt kad spiežot pogu infromācija ievietojas datubāzē bez lapas pārlādēšanas un arī izmet informāciju vai reģistrācija ir izdevusies vai nav! Kur varētu ko tādu iegūt!? varbūt ir kāds vienkārš pliks kods kuru varētu izmantot?

 

 

Paldies jauiepriekš!

Link to comment
Share on other sites

register.php

 

<?php
error_reporting(E_ALL);
include "header.php";
include "fcs/dbase.php";
include "lang/lv.php";


echo "<div id='blanket' style='display:none;'></div>";
echo "<div id='popUpDiv' style='display:none;'>";
echo "<div class='content'>";



echo "<form method='post' action='fcs/reg.php' autocomplete='off'>";

echo "<span class='error' style='display:none'> Please Enter Valid Data</span>";
echo "<span class='success' style='display:none'> Registration Successfully</span>";


echo "<input type='text' name='user_name' id='user_name'/>";
echo "<input type='text' name='user_email' id='user_email'/>";
echo "<input type='password' name='user_pass' id='user_pass'/>";
echo "<input type='password' name='user_pass2' id='user_pass2'/>";
echo "<input type='submit' name='register' value='".$lang['reg05']."' />";
echo "</form>";


echo "</div></div>";

echo "<input type='submit' value='register' onclick=\"popup('popUpDiv')\">";
?>

 

reg.php

 

<?php
include ("dbase.php");

$user_name = mysql_real_escape_string(trim($_POST['user_name']));
$user_email = mysql_real_escape_string($_POST['user_email']);
$user_pass = md5($_POST['user_pass']);
$user_date = date('y.m.d');

if ($_POST['user_pass'] != $_POST['user_pass2']) {
       echo "Paroles nesakriit";
       }


$add = "INSERT INTO users (user_name, user_email, user_pass, user_date) VALUES ('$user_name', '$user_email', '$user_pass', '$user_date')";
$result = mysql_query($add) or die(mysql_error());

if($result){
echo "All done!";
}else {
echo "ERROR";
}
echo "<div id='results'></div>";
?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...