Page php id play

Hello guys. I am trying to build a games website using PHP for database to store game information. I’m trying to learn how to fetch ID information. For example: www.blabla.com/games.php?id=12345′ As you can see, right after games.php, there is ‘?id=12345’. Anyhow, when a user clicks or types this link, that user should be directed to the game based on the ID written at the end of the link. So basically I’m trying to figure out how to fetch a row of information per ID in mysql database. So when a user enters the games.php page, they should see that the ID shows the Title of the game, the SWF flash file to play, and the Image Icon of that particular game. Overall, this would be the scene of a user trying to play my games on my site: 1. User types: www.blabla.com/games.php?id=12345 2. User enters games.php through a new window and the ID found from the link fetches Title, SWF game and Image Icon based on the ID written in the link. fldGameName
========================
| |
| |
| |
|Flash Game executed|
| (fldSwfFile) |
| |
| |
| |
==========================
fldImageIcon
The best example I can give you guys if nobody understands, is to visit www.games68.com as this is what I am trying to execute on my website. If you click on their games, they have games.php?id=12345 as their URL’s.
This is the code I so far have on my page but does not work AT ALL:
===================================================================
$conn = mysql_connect(«host», «username», «password»);
mysql_select_db(«games»);
$game_id = $_GET;
$sql = «SELECT * FROM games WHERE LIMIT 1»;
$result = mysql_query($sql, $conn) or die(mysql_error());
$number_of_results = mysql_num_rows($result); while ($result_array = mysql_fetch_array($result, MYSQL_ASSOC)) < $id = $result_array;
$title = $result_array;
$iconsmall = $result_array; // Example: game1234.png
$swf = $result_array; // Example: game1234.swf
$iconsmall_file_location = ‘http://www.blabla.com/games/images/’ . $iconsmall;
$swf_file_location = ‘http://www.blabla.com/games/’ .$swf; echo ‘http://www.blabla.com/final.php?id=’ . $id . ‘»>’;
echo ‘

Содержание
  1. ‘ . $title . ‘
  2. need help with play.php — Page 2
  3. Как сделать страницы с идентификатором?
  4. Блог вебмастера
  5. создание сайтов, заработок в сети, раскрутка, программирование
  6. Как спарсить play market на php
  7. Поменялся html-код страницы play.google.com, что делать
  8. Защита от запросов
  9. Английская или русская версия
  10. Помощь с парсером
Читайте также:  Java string строки обработка

‘ . $title . ‘

‘;
echo ‘ ‘;
echo ‘‘;
echo »;
echo ‘‘;
echo ‘‘;
echo ‘
‘; >
?>
=================================================================== Another PHP expert has told me that there is no problem with the code, it must be how I uploaded the PHP file. Moreover, I was told that keeping ‘echo ‘http://www.blabla.com/final.php?id=’ . $id . ‘»>’;’ in the same page of the script would result going back to the same PAGE, which is final.php, and wouldn’t make any sense when fetching ID.
I am really confused. Can anybody BUILD another example or a similar example like www.games68.com and how they FETCH their games through ID? I’m beginning to think the script above does not work at all. I just need another form of script that will access my database through ID by link, and fetch a row of information to display Title, SWF flash and Image per ID of a game. Any help would be appreciated. Thanks.

We’re a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.

Reach out to all the awesome people in our web development community by starting your own topic. We equally welcome both specific questions as well as open-ended discussions.

Источник

need help with play.php — Page 2

Yes, but what happen when you did like that? I think you do not understand what I am saying, the above code will not affect your url display, your url display only coming from the link, not from there. so tell me clearly what happening after implementing the above code.

Читайте также:  Object oriented programing in python

I understand you all your code working perfect the problem is only the url displaying music1.mp3 i think you understand me

Hi Raja i did a pop up player and all my mp3 file in a single directory to the server i created a database here is what i did please help me
accessdb.php

  else < // you can fetch data from database result set using mysql_fetch_assoc() $row = mysql_fetch_assoc($result); ?> 

?>
  else 

?>

I’ll jump in here. I noticed that bit of code before, and it seems odd. First, you’re opening and closing PHP unnecessarily. Second, you have no code if your condition is met. Third, now that I look at it, your if statement isn’t closed, and your table TD tags aren’t closed. Nothing is going to work right from the start of your table tags aren’t tags and statements aren’t opened and closed properly. Get a good syntax colouring text editor like Notepad++ (free), then validate your HTML — that will help you a lot. See my signature lines below for links. Instead of:

Further to that, it’s hard to read this code without the wider context of what’s happening. Is player.php supposed to receive the song id as a query string? If that’s the case, you want to do something like this;

if (isset($_GET['id']) && $_GET['id'] != "") < $id = $_GET['id']; // connect to database server and select db to work with $link = mysql_pconnect('localhost','peter','123456'); mysql_select_db('audio'); // capture data from database $query = "SELECT * FROM mp3s WHERE LIMIT 1"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) < // create a variable for each attribute foreach($thisrow as $var =>$value) < $$var = $value; >?> 
" type="audio/x-pn-realaudio-plugin" CONSOLE="Clip1" CONTROLS="ControlPanel,StatusBar" HEIGHT="57" WIDTH="400" AUTOSTART="true">

> else

Источник

Как сделать страницы с идентификатором?

Как сделать рамку, вокруг страницы (по размеру этой страницы)?
заранее спасибо :scratch:

Как сделать так, чтобы задний фон страницы не прокручивался вместе с передним фоном страницы ?
Как сделать так, чтобы задний фон страницы не прокручивался вместе с передним фоном страницы ?

Как сделать страницы
вот мой код $q="SELECT*FROM news ORDER BY id DESC"; $r=mysql_query($q); .

Как выяснить, является ли текст идентификатором?
Дан текст. Как выяснить, является ли этот текст идентификатором?

Эксперт JSЭксперт HTML/CSSЭксперт PHP

Эксперт JSЭксперт HTML/CSSЭксперт PHP

ЦитатаСообщение от freelc2015 Посмотреть сообщение

form action='' method='GET'> input type='text' name='id' placeholder='Введите ID'> input type='submit' value='Отправить'> /form>

ЦитатаСообщение от freelc2015 Посмотреть сообщение

$querty=$link->query("SELECT*FROM `razdeli`"); while($row = $querty->fetch_array()){ echo "$row[id]'>"; }

Эксперт JSЭксперт HTML/CSSЭксперт PHP

ЦитатаСообщение от freelc2015 Посмотреть сообщение

вы вообще знакомы с php,html? я думаю нет т.к вы даже не знаете метода передачи данных POST,GET прочитайте, про циклы,условие и и т.п.
И ваши вопросы отпадут.
Т.к. рассказывать вам то что есть в любой книги, я думаю не за чем.

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
 // CONNECT TO THE DATABASE $DB_HOST = ''; $DB_USER = ''; $DB_PASS = ''; $DB_NAME = ''; $mysqli = new mysqli($DB_HOST, $DB_USER, $DB_PASS, $DB_NAME); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } // A QUICK QUERY ON A FAKE USER TABLE $query = "SELECT DISTINCT Title FROM movie WHERE ID_movie IN ( SELECT DISTINCT ID_Movie FROM actor_scene WHERE ID_actor=$_GET[actor]) "; $result = $mysqli->query($query) or die($mysqli->error.__LINE__); // GOING THROUGH THE DATA if($result->num_rows > 0) { while($row = $result->fetch_assoc()) { echo stripslashes($row['Title'])."
"
; echo " "; } } else { echo 'NO RESULTS'; } // CLOSE CONNECTION mysqli_close($mysqli); ?>

ЦитатаСообщение от freelc2015 Посмотреть сообщение

ЦитатаСообщение от Glart Посмотреть сообщение

ЦитатаСообщение от fanatikus Посмотреть сообщение

ЦитатаСообщение от Glart Посмотреть сообщение

ЦитатаСообщение от Azdeman Посмотреть сообщение

Эксперт HTML/CSSЭксперт PHP

ЦитатаСообщение от freelc2015 Посмотреть сообщение

ЦитатаСообщение от KOPOJI Посмотреть сообщение

все зависит от того, что именно вы хотите сделать
1. процедурный подход или ООП
2. с использованием шаблонов или так, вперемешку
3. вытекающее из ООП по сути — MVC или нет
4. сложность самого движка (свой собственный фреймворк?) Добавлено через 11 минут
самый простой «движок» можно намутить из одной страницы, что с использованием ООП, что с использованием процедурного подхода.

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
 if(isset($_GET['cat'])) { $head = ''; //подключаемые скрипты и стили switch($_GET['cat']) { *case 'contact': $title = 'Контакты'; $content = 'С нами можно связаться. '; break; case 'about': $title = 'О нас'; $content = 'Информация о нас'; break; default: $title = 'Главная'; $content = 'Приветствую';break; } } else { $head = ''; //подключаемые скрипты и стили $title = 'Главная'; $content = 'Приветствую'; } ?> html> head>$head;?> title>$title;?>title> head> body> div> a href="$_SERVER['PHP_SELF'];?>">Главнаяa> a href="?cat=contact">Контактыa> a href="?cat=about">О насa> div> br>br>div> $content;?> div> body> html>

Источник

Блог вебмастера

создание сайтов, заработок в сети, раскрутка, программирование

Php парсер с гугл плей маркет. Парсим версию, и другие данные.

Как спарсить play market на php

Выложу простой код, который на примере «Текущей версии» парсит страницу приложения в play market.

Все работает с использованием file_get_contents. Для одного сайта делал парсер, и если текущая версия отличалась от той, что в маркете — записывалось в текстовый файл. Кроме того, пользователи могли нажать кнопку «Сверить версии«, и дополнительно уведомить админа об обновлениях (если они есть).

Потом админ обновлял приложения у себя на сайте.

Я выложу полный код с комментариями:

$curr_page = $_POST [ ‘curr_page’ ] ; // Текущая страница сайта; нужно для уведомлений с какой страницы заявка

$url = ‘https://play.google.com/store/apps/details?id=’ . $packname ; // Адрес приложения, с подставкой имени пакета

//$url = ‘https://play.google.com/store/apps/details?id=com.whatsapp’; // Пример ссылки, закомментировано

$first_step = explode ( ‘Current Version

‘ , $html ) ; // Извлекаем версию. Обратите внимание на классы

if ( strpos ( $second_step [ 0 ] , ‘Varies with device’ ) !== false ) < // Если пишет не версию, а "Зависит от устройства", тогда выводим пользователю:

echo «Нам не удалось определить версию этого приложения на Google Play, возможно версия приложения зависит от устройства, поэтому мы проверили дату обновления. Новая версия на Google Play еще не выходила.» ;

echo ‘Версия на Google Play: ‘ . str_replace ( PHP_EOL , » , $second_step [ 0 ] ) ; // Выводим версию с плей маркета

echo ‘Обновлять приложение нет необходимости’ ; // Если одинаковые — то ничего не делаем, просто уведомляем

$content2file = date ( «d-m-Y H:i:s» ) . ‘: https://bdseo.ru’ . $curr_page . ‘ — ‘ . $second_step [ 0 ] . PHP_EOL ; // Пишем время, страницу с которой вызвали «Сверить версию», и актуальную версию

file_put_contents ( $file , $content ) ; // Temp делал для того, чтобы новые строки были в начале файла.

> else echo ‘Нам не удалось определить версию этого приложения на Google Play, возможно приложение не найдено. Мы приняли вашу заявку.’ ;

Описал в комментариях. Еще у нас были привязаны уведомления в телеграмм. Основное оставил. По сути, все сокращается до

И правильно распарсить строку с версией.

Поменялся html-код страницы play.google.com, что делать

За последние пару месяцев код не менялся, но не исключено. Зайдите в исходный код, посмотрите актуальные классы.

Защита от запросов

Есть ли капча? Не знаю, у нас не было никаких проблем. Возможно, при большом количестве запросов с одного айпи может быть рекапча или еще что-то. Пользуемся в таком случае прокси.

Английская или русская версия

Все зависит откуда парсите, месторасположение сервера (прокси). У нас страница по умолчанию была на английском, поэтому и «Current Version, Varies with device». Можно добавить в адрес url язык, но нам это не нужно было.

Если нужно спарсить другие данные (дата публикации, информация о разработчике, эмейл разработчика), заново вызывать file_get_contents не нужно, страница уже в переменной $html.

Помощь с парсером

Нужна помощь — без проблем. Пишите. Но только если Вы делаете и Вам нужен совет.

Если вы хотите чтобы я сделал парсер, написал код — делаю за деньги, цена от 5000 рублей.

Источник

Оцените статью