of     2   
chevron_rightchevron_rightchevron_right

koen500
#122964717Sunday, January 12, 2014 4:14 PM GMT

Can someone give me an example of a script in PHP/HTML that handles a HttpRequest coming from Roblox, and makes use of a MySQL database?
koen500
#123195426Wednesday, January 15, 2014 6:44 PM GMT

Bump.
Dr01d3k4
#123196553Wednesday, January 15, 2014 7:09 PM GMT

"script in ...HTML" What? HTML has nothing to do with this.
As8D
#123199042Wednesday, January 15, 2014 8:02 PM GMT

Do PHP - though people who wuv othr stuff might nawt liek eet; here's exampleh: Your website server, running PHP & MySQL database (> and < replaced with gt and lt): _____________________________________________________________ lt?php $yourVariable = addslashes($_GET["yourParam"]); $db = mysql_connect("localhost", "yourusername", "yourpwarzwurd"); mysql_select_db("nameOfDatabase", $db); if (is_numeric($yourVariable)) { $exist = mysql_query("SELECT Name, Content, ID FROM YourCollection WHERE ID = $yourVariable"); if ($exist) { $exist = mysql_fetch_array($exist); } if ($exist) { echo "{name = '" . addslashes($exist["Name"]) . "', Content = '" . addslashes($exist["Content"]) . "', ID = $exist[ID]}"; } else { echo "Error: Could not fetch information."; } } else { echo "Error: Invalid parameter."; } mysql_close($db); ?gt _____________________________________________________________ Your roblox server, Lua: _____________________________________________________________ local http = game:service("HttpService") function getContent(id) local content = http:GetAsync("http://yourdomain.dot/yourfile.php?yourParam=" .. (tonumber(id) or 1)) if loadstring("return " .. content) then return loadstring("return " .. content)() else return content end end print(getContent(1)) _____________________________________________________________ Since this is just an example - untested, no idea if it works - I will let you figure out what happens where. Read up on dez PHP and MySQL. - As, yo dun mess wit databases. dem databases mess wit u, doed.
TheLuaWeaver
#123199054Wednesday, January 15, 2014 8:03 PM GMT

I can put a script in HTML! Replace [] with , because ROBLOX thinks I'm trying to XSS. [script]alert("Amg, script in HTML!!!1");[/script] ~LuaWeaver; Programmer, gamer, developer.
koen500
#123261691Thursday, January 16, 2014 4:13 PM GMT

Thank you for the example, it will be very useful when managing my database!
triston220
#123262810Thursday, January 16, 2014 4:38 PM GMT

Apart from the fact that the mysql_* family of functions are depreciated and are due to be removed from future versions of PHP. You should use the mysqli* functions or PDO instead. I highly doubt you need such a system anyway.
jode6543
#123266878Thursday, January 16, 2014 6:20 PM GMT

Also, addslashes should be replaced with mysql[i]_real_escape_string, since addslashes is not designed to be used for security or sanitization purposes. ~Jode
koen500
#123272143Thursday, January 16, 2014 8:06 PM GMT

What do I do wrong when it returns the code of the .php file?
jode6543
#123276293Thursday, January 16, 2014 9:12 PM GMT

That means you either don't have PHP installed or haven't configured Apache (or whatever you're using) to use it. ~Jode
xtomtom75
#123281221Thursday, January 16, 2014 10:13 PM GMT

I'm a scripter helper, helping you by telling you... GO SEE THAT WIKI :3 joke lol
koen500
#123495920Sunday, January 19, 2014 12:37 PM GMT

Maybe there's some easyer hosting site than heliohost, any suggestions? Because I do not know what to do with it anymore.
Alyte
#123498660Sunday, January 19, 2014 1:52 PM GMT

Google AppEngine
koen500
#123499286Sunday, January 19, 2014 2:03 PM GMT

It is not free.
devTree
#123499668Sunday, January 19, 2014 2:11 PM GMT

In AS8D's script, I thought he was saying sexist without getting the post blocked by the filter or something. Sorry, don't know much JavaScript and stuff like that.
koen500
#123500894Sunday, January 19, 2014 2:35 PM GMT

Is there anyone willing to make a very full tutuorial on how to do such things?
triston220
#123512503Sunday, January 19, 2014 5:20 PM GMT

What is it you're wanting to do?
koen500
#123515401Sunday, January 19, 2014 5:56 PM GMT

I want to make a ban system, cross place.
cntkillme
#123515760Sunday, January 19, 2014 6:00 PM GMT

Why does everyone use MySQL extension on PHP but not MySQLi or PDO? Apparently most hosts are upgrading and MySQL is going to be removed.
koen500
#123516092Sunday, January 19, 2014 6:04 PM GMT

Well, I only know MySQL, that is why. But I know of none of them how they work.
cntkillme
#123516248Sunday, January 19, 2014 6:06 PM GMT

I learned PDO and MySQLi in a day (not on the same day, of course) I mean I'm not great at it but I can do what I need to do, anytime I need help I would search something like: "mysqli equivalent of mysql_whatever"
koen500
#123516455Sunday, January 19, 2014 6:09 PM GMT

What hosting site do you use?
Dr01d3k4
#123516734Sunday, January 19, 2014 6:12 PM GMT

Using Django, a cross place ban system is easy. This is a very simple one I made in 10 minutes (though it's not complete - need django specific code like project settings, etc and doesn't support unbanning of users, having timed bans, and any user can submit a post). Also because it's Django, you get a very nice admin interface you can manage all the bans from. pastebin/RUm2TzbM
Alyte
#123517822Sunday, January 19, 2014 6:24 PM GMT

>It is not free. Yes it is *facenuke*
koen500
#123518502Sunday, January 19, 2014 6:31 PM GMT

The storage is not free.

    of     2   
chevron_rightchevron_rightchevron_right