- Запрос на наличие имя и пароля в бд
- Решение
- Решение
- Find php database password
- About DNS Settings:
- If your DNS is worked withARZhost
- In case you just presented a WordPress One-Click Install
- In case your DNS isn’t worked withARZhost
- What A records do I manage my site toward?
- Open the Websites page in the board.
- Stage 1 — Find your data set name
- Stage 2 — Find your username
- Stage 3 — Find your password
- Stage 4 — Find your hostname
Запрос на наличие имя и пароля в бд
Здравствуйте ребята, помогите написать код php. Нужно что бы при запросе к моему сайту такого вида «http://site.ru/proverka.php?name=Admin&pass=12345678» проверял , есть ли такое имя Admin с паролем 12345678 в моей бд MySQL, а если есть, то что бы написало «Yes», а если нет, то «No».
Проверка пароля на наличие символов
День добрый. Есть примерно такой код if (preg_match(‘/^*$/u’, $email)) die("Пароль должен.
Проверка пароля на наличие последовательностей
Доброго времени суток, уважаемые форумчане! Собственно, столкнулся вот с такой задачей: нужно.
Проверка на наличие пароля и пропуск по возможности
Есть проблемка, а идей по её решению нет. Может мозговым штурмом можно её решить. Суть.
Проверка пароля на наличие верхнего регистра, цифр и символов
Есть ли какой-то просто и малокодный способ проверки пароля, вводимого в textbox на необходимость.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
if(!isset($_SESSION['user_id'])) { if (isset($_POST['submit'])) { $dbc = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD); $db = "имя БД"; mysql_select_db($db) or die (mysql_error()); $user_name = mysql_real_escape_string(trim($_POST['username'])); $user_password = mysql_real_escape_string(trim($_POST['password'])); if (!empty($user_name) && !empty($user_password)) { $query = "SELECT user_id, username FROM таблица пользователей WHERE username = '$user_name' AND password = SHA('$user_password')"; $data = mysql_query($query) or die ('Err SELECT ' . (mysql_error()) ); if (mysql_num_rows($data) == 1) { $row = mysql_fetch_array($data); $_SESSION['user_id'] = $row['user_id']; $_SESSION['username'] = $row['username']; setcookie('user_id', $row['user_id'], time() + (60 * 60 * 24 * 30));//срок действия куки 30 дней setcookie('username', $row['username'], time() + (60 * 60 * 24 * 30));//срок действия куки 30 дней $home_url = 'index.php'; //типо Ваше "ДА" header('Refresh: 2;' . $home_url); include ('access.php'); } else { //типо Ваше "НЕТ" $error_msg = 'wrong login/password'; $log_url = "login.php"; header('Refresh: 2; ' . $log_url); } }
Скиньте лучше готовый код, а то под себя редактирую и не хочет заходить на сайт
Добавлено через 23 секунды
И мне без куки
Сообщение было отмечено Nekich как решение
Решение
Сообщение от Nekich
Нужно что бы при запросе к моему сайту такого вида «http://site.ru/proverka.php?name=Admin&pass=12345678» проверял
if (isset($_GET['name']) && isset($_GET['pass'])) { $db = mysqli_connect("localhost", "username", "password", "db_name"); $sql = mysqli_query($db, "SELECT * FROM `table_name` WHERE `value_name`='".$_GET['name']."' AND `value_pass`='".$_GET['pass']."'"); if (mysqli_num_rows($sql) > 0) { echo "Yes"; }else { echo "No"; } }
Да конечно данные перед запросом надо обработать, но тут наверно об этом нет и речи так как и так пароль передаем через гет
Сообщение от Виталюска
Я написал этот код в файл php, ввел те же данные что и в базе данных было, но мне пишет почему то «No»
$sql = mysqli_query($db, "SELECT * FROM `table_name` WHERE `value_name`='".$_GET['name']."' AND `value_pass`='".$_GET['pass']."'") or die (mysqli_error());
Сообщение от Nekich
Сообщение от Виталюска
Сообщение от Nekich
Теперь вообще ничего не пишет
покажи как передаёшь код в proverka.php
вообще покажи один и второй файл
Ооооо, спасибо, я нашел ошибку, теперь работает
Добавлено через 3 минуты
Сообщение от Виталюска
Сообщение от Nekich
Теперь вообще ничего не пишет
покажи как передаёшь код в proverka.php
вообще покажи один и второй файл
Можешь написать пожалуйста скрипт, что бы вместо «Yes» писало id этого пользователя из таблицы MySQLi
Сообщение было отмечено Nekich как решение
Решение
if (isset($_GET['name']) && isset($_GET['pass'])) { $db = mysqli_connect("localhost", "username", "password", "db_name"); $sql = mysqli_query($db, "SELECT * FROM `table_name` WHERE `value_name`='".$_GET['name']."' AND `value_pass`='".$_GET['pass']."'"); if (mysqli_num_rows($sql) > 0) { $row = mysqli_fetch_array($sql); echo $row['id']; }else { echo "Пользователя не существует"; } }
Можешь помочь? У меня тут еще одна проблема, мне нужно передать запрос серверу без куки, а если передать без куки, то он выдает это:
html>body>script type="text/javascript" src="/aes.js" >/script>script>function toNumbers(d));return e>function toHex()&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f ) e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()>var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("af1e875814fab9375aecbf930f58c083");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; document.cookie="referrer="+escape(document.referrer); location.href="http://nekichsoft.byethost7.com/proverkanaprivate.php?skype=&hwid=8f0bd0ea1fe67ed205d37a9bbe797045&ckattempt=1";/script>noscript>This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support/noscript>/body>/html>html>body>script type="text/javascript" src="/aes.js" >/script>script>function toNumbers(d));return e>function toHex()&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f ) e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()>var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("af1e875814fab9375aecbf930f58c083");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; document.cookie="referrer="+escape(document.referrer); location.href="http://site.ru/proverka.php?login=admin&pass=12345&ckattempt=1";/script>noscript>This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support/noscript>/body>/html>
Find php database password
Your informational collection capabilities license you to sign into your informational collection in the board using phpMyAdmin. phpMyAdmin is a graphical device where you can investigate through your informational index and make changes.
These comparable certificates can in like manner be used to connect with the data base using any item you like.
About DNS Settings:
If your DNS is worked with ARZhost
In case your name servers are worked with at ARZhost, proceed with the methods below:
In case you just presented a WordPress One-Click Install
In case you just presented a WordPress One-Click Install (and your name servers are featured ARZhost), you ought to hold several hours for the new MySQL subdomain to invigorate. At the point when the DNS has spread on the web, your site will device with your informational index.
In case your DNS isn’t worked with ARZhost
In case your name servers are NOT worked with at ARZhost, you should make A record (at your current working with association) for your mysql.example.com hostname to feature ARZhost. After that MySQL A record updates would the phpMyAdmin device in your board work. View the going with article for connection on the most capable plan to discover your ARZhost A record. You would then have the option to contact your current working with association to add it to their structure.
What A records do I manage my site toward?
You can manage your space selection and name servers at any recorder you like and still host your site at ARZhost. In any case, this is only essential if you need to remain for specific organizations at another (like email) while working with the site at ARZhost.
- On the off chance that it’s not all that much difficulty, note that the IP address may really change in view of a laborer move. In case ARZhost ever needs to move your worker to another IP address, you will be told by email going before the moving.
- To ensure your site remains completely operational without voltage, you ought to revive your site’s IP address to the new IP address referred to How to find database username and password in phpMyAdmin in the email you got.
- It’s especially remarkable that this happens, anyway it’s a possibility you should think about while using A records.
- If they are featured another association, you’ll need to plan A records at that association to feature your ARZhost site.
Open the Websites page in the board.
Snap the webpage’s DNS tab on the Manage Websites page to see your records.
The “A” type record found there (appeared as an IPv4 address) should be reproduced into the DNS settings of the non-ARZhost provider.
In the model over, the site A records would be 173.236.241.132. This is a comparable IP address for the www and non-www variation of the site URL. Use the IP for some other assistance recorded a comparable way.
Stage 1 — Find your data set name
Visit the MySQL Databases page and peer down to the section named Databases on this laborer. Under you’ll see a posting of your informational collections.
In case you have special data bases, you’ll need to recognize the one that identifies with your site. This can for the most part be found in the site’s plan record, yet every application puts this in a substitute territory. Advice your application’s data base for game plan record zones.
Stage 2 — Find your username
The specific username joined to the informational index is inclined aside of your informational collections.
Stage 3 — Find your password
Stage 4 — Find your hostname
Investigate back to the MySQL Databases page.
Near the top you’ll see a section named Hostnames for this MySQL laborer. Quest for the hostname that identifies with your site. It more than likely has the site’s name in it.
Aside of the hostname is an association named phpMyAdmin. Snap this associate with open the phpMyAdmin login page.
Sign into phpMyAdmin