generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: JavaScript - PHP - Suggestions ect.

Previous Thread :: Next Thread 
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
23 Aug 2013 06:11 PM
Hia.

I'm currently making a forum on my website as a fun project.

At first, I tried making it in 2 parts:
- DHTML with a function to send xmlhttprequest..s.. to the PHP file.
- A PHP file to handle database queries. Using predefined queries, such as 'getThread' would fetch information about a thread from a given ID ect.

The problem I encountered was that when I tried to fetch data multiple times in the same instant, the response would often get switched around, so that the 1st request would get the 2nd response and vice versa...
(Example:
We have a function that is called every 2 second, it has to perform 2 (actually more, as the result of one of the 2 is used for a loop fetching the data for each thread*) database-related actions so far:
- Is the user online?
- Update forum to show new threads.
- Get name, author, publishing date, replies, views, last replier and 'can comment' on a thread.*
)

I've now started on moving the PHP stuff over to the JavaScript function that used these xmlhttprequest-objects to send POST-data to the PHP file... though my website is configured in a rather questionable way when relating to PHP (such stuff as if there (flip questionmark) <¿php instead of <¿, I can download the page instead of having it shown in my internet browser... ugh...)


So yeah, to skip more of this, what do you suggest is good to do? I'd like JavaScript to keep stuff fast and neat.

- As, guiz, I haven't looked much into iMySQL so far :c
Report Abuse
SecantFuture is not online. SecantFuture
Joined: 21 Aug 2013
Total Posts: 63
23 Aug 2013 06:18 PM
Post Data is easy, use jQuery library so its easier to use post methods.
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
23 Aug 2013 06:20 PM
Oh. Ajax.


Heard about it before...

- As, well, Ajax is also present in a lot of modern Mickey Mouse movies?
Report Abuse
ExpertProgrammer is not online. ExpertProgrammer
Joined: 06 Jun 2013
Total Posts: 283
23 Aug 2013 06:23 PM
SecantFuture: The use of jQuery is unnecessary in this situation.
Report Abuse
SecantFuture is not online. SecantFuture
Joined: 21 Aug 2013
Total Posts: 63
23 Aug 2013 06:23 PM
$.post("URL",{/*Post Data*/Username : "As8D",P : "loltest123"},function(Data){console.log("THIS IS CALL BACK : " + Data)})

or you can use

$.ajax({url : "url",type : "POST",data : {/*FormData*/},success : function(data){console.log("Callback" + data)}})


^ something like those in jqeury
Report Abuse
SecantFuture is not online. SecantFuture
Joined: 21 Aug 2013
Total Posts: 63
23 Aug 2013 06:24 PM
Well, if hes just using HTML than he would need forms and PHP to recieve the POST data $_POST[Info]
Report Abuse
MemoryAddress is not online. MemoryAddress
Joined: 20 Apr 2013
Total Posts: 1297
23 Aug 2013 06:50 PM
[ Content Deleted ]
Report Abuse
Techboy6601 is not online. Techboy6601
Joined: 29 Jun 2009
Total Posts: 4914
23 Aug 2013 08:07 PM
Don't rely too much on Javascript. People with low end computers (i.e. mobile devices) will have a bad time.
Report Abuse
SecantFuture is not online. SecantFuture
Joined: 21 Aug 2013
Total Posts: 63
23 Aug 2013 08:24 PM
^ That's why Android is better for sites and stuff.
Report Abuse
Techboy6601 is not online. Techboy6601
Joined: 29 Jun 2009
Total Posts: 4914
23 Aug 2013 08:30 PM
What are you talking about? There are plenty of low end Android models that can barely load the jQuery library without running out of memory.
Report Abuse
SecantFuture is not online. SecantFuture
Joined: 21 Aug 2013
Total Posts: 63
23 Aug 2013 08:38 PM
You do understand that jQuery is only text and its not taking a lot of RAM/Memory, plus I think you're thinking of OLDER OLDER ANDROID
Report Abuse
18cwatford is not online. 18cwatford
Joined: 08 Oct 2009
Total Posts: 5410
23 Aug 2013 11:23 PM
" low end Android"
cause low end can easily easily easily easily easily easily run new new new android android new android
Report Abuse
Techboy6601 is not online. Techboy6601
Joined: 29 Jun 2009
Total Posts: 4914
23 Aug 2013 11:26 PM
"jQuery is only text"

Yes, so are all programming languages. Interpreting/compiling them takes significant amount of processing power the bigger and more complex they get.

Also, I don't understand why you're referencing Android here. As a web developer you're going to have to deal with many other devices; including iOS, Windows Phone, and every other mobile device operating system in use today. You don't get to choose which devices visit your site (well, you do, but limiting your site to specific devices is incredibly stupid).
Report Abuse
MemoryAddress is not online. MemoryAddress
Joined: 20 Apr 2013
Total Posts: 1297
24 Aug 2013 12:58 PM
[ Content Deleted ]
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
24 Aug 2013 01:11 PM
Hm.

Well, to skip making another thread, as this can be related to the main topic (continuation of the story, yay), here's another thing:

I looked up what would be most efficient to do to store user thumbnails on my server.
Found a page on stackoverflow saying that storing images on a database uses 3 times as much memory as if they're created as images (servername.com/Folder/Images/ImageNameNumber.png for example)

So, taking that in consideration, what do you suggest? What's best while considering security, exploitability, efficiency and such?

- As, fabulous. Now, make a Lego Mobile... NXT... uh... yeah... including wheels!
Report Abuse
batistapowerbonbtla is not online. batistapowerbonbtla
Joined: 16 Dec 2011
Total Posts: 2203
24 Aug 2013 01:30 PM
You actually considered storing images in the database?
help me
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
24 Aug 2013 01:31 PM
BLOLBs =D
Report Abuse
SCARFACIAL is not online. SCARFACIAL
Joined: 28 Jan 2010
Total Posts: 7970
24 Aug 2013 01:38 PM
It's much easier to upload the image to a folder and reference it in your database. I'm not sure why you would do it any other way.
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
24 Aug 2013 01:59 PM
Hm, ye.

Well, I experimented with editing files just... within the last year.
Otherwise, I've never had any situations where database vs. image file storage mattered much.

But okay, it'll be files, then I'll look up what I can do to make it secure.

- As, onform.
Report Abuse
As8D is online. As8D
Joined: 24 Dec 2009
Total Posts: 2907
24 Aug 2013 02:02 PM
@Scar;

Well, I was just thinking of having this:

UserThumbnails/Thumb[the ID of the user here].png


Then the images would have the size of... let's say 256x256 (I'll need a way to avoid messing up the quality, but cutting off at larger images :I)

- As, what's saved is... saved... yeah. In most cases you can use it though.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image