Current time: 17 Apr 2024, 10:19 PM



PHP help!
Away SmG FlasH™

Senior Member
Senior Member
******
10 Years of Service
Posts: 3,129
Threads: 102
Likes Received: 0 in 0 posts
Likes Given: 0
Joined: Apr 2013
Reputation: 141
Location: Summoners Rift
Halo GodCrystal DonatorSmoothThe BombDiscord WarriorGavel of Trinity
DiamondGamerProgrammerThanks From Cloud
#1
PHP help!

So I started learning PHP and need some help. Basically, I want the relevant information to appear when the user enters the ID. 

For example: 

* Form contains 3 input boxes, ID, Name and Type. (ID's  are within a drop down menu, Name and Type in an input box)
* When user selects the first ID (assuming its 001), the relevant name and type corresponding to the same ID have to be displayed. (in real time / redirect back to page)

PM me for code. Thank you in advance :3
[Image: SPOILER_FlasH-1.gif]
16 Sep 2016, 11:29 PM
Find Reply
Away SmG Blade

Senior Member
Senior Member
******
9 Years of Service
Posts: 3,008
Threads: 127
Likes Received: 3 in 3 posts
Likes Given: 1
Joined: Mar 2015
Reputation: 97
GeniusThanks From CloudDiscord WarriorDiscord MasterHalloweenChristmas 2018
#2
RE: PHP help!

Cannot help you with the code much as exams.

You can do a switch and echoing SQL queries.

Cannot think of a real time possibility.
Stonks
17 Sep 2016, 04:56 PM
Find Reply
Offline Skywrath

Banned
Banned
*
9 Years of Service
Posts: 577
Threads: 23
Likes Received: 0 in 0 posts
Likes Given: 0
Joined: May 2014
Reputation: -25
Thanks From CloudEmerald Donator
#3
RE: PHP help!

(16 Sep 2016, 11:29 PM)SmG FlasH™ Wrote: So I started learning PHP and need some help. Basically, I want the relevant information to appear when the user enters the ID. 

For example: 

* Form contains 3 input boxes, ID, Name and Type. (ID's  are within a drop down menu, Name and Type in an input box)
* When user selects the first ID (assuming its 001), the relevant name and type corresponding to the same ID have to be displayed. (in real time / redirect back to page)

PM me for code. Thank you in advance :3

Ill give this a try using havij tonight, and see if it gives me the string, so you could hopefully reverse engineer it. 

Otherwise, I found this on a support website, take from it what you will, if you need a legend on what certain things mean, I can provide you with additional content:

Code:
 [color=black][size=small][size=x-small][color=#ff8000]//Array with the data to insert
[/color][color=#0000bb]$sql_array [/color][color=#007700]= array(
    [/color][color=#dd0000]'username'    [/color][color=#007700]=> [/color][color=#dd0000]'admin'[/color][color=#007700],
    [/color][color=#dd0000]'email'        [/color][color=#007700]=> [/color][color=#dd0000]'admin@example.com'[/color][color=#007700],
);

[/color][color=#ff8000]// Create the SQL statement
[/color][color=#0000bb]$sql [/color][color=#007700]= [/color][color=#dd0000]'SELECT user_id 
        FROM ' [/color][color=#007700]. [/color][color=#0000bb]USERS_TABLE [/color][color=#007700]. [/color][color=#dd0000]' 
        WHERE ' [/color][color=#007700]. [/color][color=#0000bb]$db[/color][color=#007700]->[/color][color=#0000bb]sql_build_array[/color][color=#007700]([/color][color=#dd0000]'SELECT'[/color][color=#007700], [/color][color=#0000bb]$sql_array[/color][color=#007700]);

[/color][color=#ff8000]// Run the query 
[/color][color=#0000bb]$result [/color][color=#007700]= [/color][color=#0000bb]$db[/color][color=#007700]->[/color][color=#0000bb]sql_query[/color][color=#007700]([/color][color=#0000bb]$sql[/color][color=#007700]);

[/color][color=#ff8000]// $row should hold the data you selected
[/color][color=#0000bb]$row [/color][color=#007700]= [/color][color=#0000bb]$db[/color][color=#007700]->[/color][color=#0000bb]sql_fetchrow[/color][color=#007700]([/color][color=#0000bb]$result[/color][color=#007700]);

[/color][color=#ff8000]// Be sure to free the result after a SELECT query                        
[/color][color=#0000bb]$db[/color][color=#007700]->[/color][color=#0000bb]sql_freeresult[/color][color=#007700]([/color][color=#0000bb]$result[/color][color=#007700]);

[/color][color=#ff8000]// Show we got the result we were looking for
[/color][color=#007700]echo [/color][color=#0000bb]$row[/color][color=#007700][[/color][color=#dd0000]'user_id'[/color][color=#007700]];[/color][/size][/size][/color]
[color=black][size=small][size=x-small][color=#007700][/color][/size][/size][/color]
[color=black][size=small][size=x-small][color=#007700]
18 Sep 2016, 06:54 AM
Find Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)
SmG Gaming, © 2010-2024
Theme By: «SmG» Cloud
Edited by: «SmG» Wires