Author Topic: The 'Simple Questions' thread.  (Read 352733 times)

0 Members and 5 Guests are viewing this topic.

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5037
Re: The 'Simple Questions' thread.
« Reply #1600 on: January 17, 2012, 02:58:29 am »
Quick question, what's the name of the meme/girl/whatever in the bottom right corner in this strip?

There are other worlds than these

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl

Im chill like that

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5037
Re: The 'Simple Questions' thread.
« Reply #1602 on: January 17, 2012, 11:39:18 am »
There are other worlds than these

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: The 'Simple Questions' thread.
« Reply #1603 on: January 17, 2012, 12:24:07 pm »
yea i find her attractive too no idea why


Im chill like that

Offline machina

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1117
  • The world isn't nice. Why should I be...?
Re: The 'Simple Questions' thread. (MySQL bad issue)
« Reply #1604 on: April 09, 2012, 01:07:15 pm »
Lol, I tried everything but I couldn't solve that shit. Here's the last one version. I just wanted to get last one variable from column id and use it to create new row in the same table called Files:

Code: [Select]
//SQL
$con = mysql_connect($sql_server, $sql_username, $sql_pass);

mysql_select_db($sql_db, $con);


$supID = mysql_query( "SELECT LAST(id) AS LastOne FROM Files" );

$row = mysql_fetch_array("LastOne");
$ID = $row['id'];
$ID= $row + 1;

echo "ID is: " . $ID;

mysql_query( 'INSERT INTO Files (id, username, server_id, file_type, date) VALUES ('(string)$ID . ',' . $username . ',' . (string)$server_id . ',' . $filetypo . ',' . $date . ')' );

mysql_close($con);

The code above might be dumb looking because of my many endavors...

Can anyone help me?

Offline Fryer

  • Camper
  • ***
  • Posts: 261
  • Game dev
Re: The 'Simple Questions' thread.
« Reply #1605 on: April 09, 2012, 01:49:11 pm »
Can anyone help me?

I'm a bit confused as to what you're trying to do, but this might work:

Code: [Select]
$con = mysql_connect($sql_server, $sql_username, $sql_pass);
mysql_select_db($sql_db, $con);

$supID = mysql_query('SELECT id FROM Files ORDER BY id DESC LIMIT 1');
$row = mysql_fetch_array($supID);
$ID = $row['id'] + 1;

echo 'ID is: ' . $ID;

mysql_query('INSERT INTO Files (id, username, server_id, file_type, date) VALUES (' . $ID . ',' . $username . ',' . $server_id . ',' . $filetypo . ',' . $date . ')');

mysql_close($con);

I still don't suggest doing it that way, but rather make 'id' a primary key in your database, and auto increment it. That would make it more secure and also make your code shorter. :)

You might also want to escape the username and other strings possibly affected by user input if you didn't already do that. It can be a huge security risk not doing it if someone suddenly decides to try their magic SQL injection tricks on your server.
...PC vs Mac is like AK47 vs M4A1...
<DutchFlame`> i once heard running runescape in the background gave you a speedboost
<Mr> yes, it allocates more electrons, so there are more electrons available for Soldat -> they are streched less and it is more fluent

Soldat PolyWorks 1.5.0.13 - AimMode - Aim practise gamemode script - Fryer's SoldatStream Mod

Offline SyavX

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 338
Re: The 'Simple Questions' thread.
« Reply #1606 on: April 09, 2012, 02:04:30 pm »
What if..?
Code: [Select]
shit code was here

P.S. Ah, there is a reply already...

Edit: shit code detected
« Last Edit: April 10, 2012, 04:51:12 pm by SyavX »

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5037
Re: The 'Simple Questions' thread.
« Reply #1607 on: April 09, 2012, 09:19:20 pm »
What if..?
Code: [Select]
mysql_select_db($sql_db, $con);

$supID = mysql_query( 'SELECT id FROM Files DESC LIMIT 1' );

$ID = mysql_result($supID) + 1;

echo "ID is: " . $ID;

mysql_query( 'INSERT INTO Files (id, username, server_id, file_type, date) VALUES (' . $ID . ',' . $username . ',' . $server_id . ',' . $filetypo . ',' . $date . ')' );

mysql_close($con);


P.S. Ah, there is a reply already...

your code fucking sucks ass

Code: [Select]
mysql_select_db($sql_db, $con);

$supID = mysql_query( 'SELECT id FROM Files order by id DESC LIMIT 1' );

list ($ID) = mysql_fetch_row($supID);

mysql_query( 'INSERT INTO Files (id, username, server_id, file_type, date) VALUES (' . $ID . ',' . $username . ',' . $server_id . ',' . $filetypo . ',' . $date . ')' );

mysql_close($con);

and for your insert query to not fucking break you'll need to quote the non-integer fields
There are other worlds than these

Offline machina

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1117
  • The world isn't nice. Why should I be...?
Re: The 'Simple Questions' thread.
« Reply #1608 on: April 10, 2012, 04:51:15 am »
Thank you all for helping me. :D In fact, I forgot that "order by id DESC LIMIT 1" and I didn't try it myself... Thanks jrgp for remembering me about that quote for non-integers... :)

If I get more issues I'll ask you again. :P

Offline machina

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1117
  • The world isn't nice. Why should I be...?
Re: The 'Simple Questions' thread.
« Reply #1609 on: April 11, 2012, 12:26:25 pm »
Sorry for repling here again so soon, but you were so useful last time, so I decided to let you get fun with helping me again.

Exactly, I wish to know how to move this:
http://example.com/user.php?username=machina

Into this:
http://example.com/user.php?=machina

Or even thing like that here:
http://example.com/user/machina

Thanks for any help :)

Offline Fryer

  • Camper
  • ***
  • Posts: 261
  • Game dev
Re: The 'Simple Questions' thread.
« Reply #1610 on: April 13, 2012, 09:54:02 pm »
Sorry for repling here again so soon, but you were so useful last time, so I decided to let you get fun with helping me again.

Exactly, I wish to know how to move this:
http://example.com/user.php?username=machina

Into this:
http://example.com/user.php?=machina

Or even thing like that here:
http://example.com/user/machina

Thanks for any help :)

You can make it into "user.php?blargh" with this:
Code: [Select]
$user = $_SERVER['QUERY_STRING'];
...PC vs Mac is like AK47 vs M4A1...
<DutchFlame`> i once heard running runescape in the background gave you a speedboost
<Mr> yes, it allocates more electrons, so there are more electrons available for Soldat -> they are streched less and it is more fluent

Soldat PolyWorks 1.5.0.13 - AimMode - Aim practise gamemode script - Fryer's SoldatStream Mod

Offline machina

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1117
  • The world isn't nice. Why should I be...?
Re: The 'Simple Questions' thread.
« Reply #1611 on: April 14, 2012, 11:27:37 am »
Okay, the last thing (I hope so).

Is it possible to get some file from external ftp server that has password we don't want to share and send it to user without downloading it on main website (where the user clicks download button). Would be nice to hide external ftp server's url but it's not so needed yet. Also, it might be impossible.

Offline Fryer

  • Camper
  • ***
  • Posts: 261
  • Game dev
Re: The 'Simple Questions' thread.
« Reply #1612 on: April 14, 2012, 08:36:39 pm »
Okay, the last thing (I hope so).

Is it possible to get some file from external ftp server that has password we don't want to share and send it to user without downloading it on main website (where the user clicks download button). Would be nice to hide external ftp server's url but it's not so needed yet. Also, it might be impossible.

I don't think it's possible to download directly from a password protected server while completely hiding the password and url, but it might be possible to make the website get it from the FTP server and then sending it to the user. And now I'll just wait for jrgp to say I'm wrong or come up with a cool idea I didn't think about because I'm too f***ing tired.

BTW, I'm now officially interested. What do you need it for?
...PC vs Mac is like AK47 vs M4A1...
<DutchFlame`> i once heard running runescape in the background gave you a speedboost
<Mr> yes, it allocates more electrons, so there are more electrons available for Soldat -> they are streched less and it is more fluent

Soldat PolyWorks 1.5.0.13 - AimMode - Aim practise gamemode script - Fryer's SoldatStream Mod

Offline machina

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1117
  • The world isn't nice. Why should I be...?
Re: The 'Simple Questions' thread.
« Reply #1613 on: April 15, 2012, 08:20:19 am »
BTW, I'm now officially interested. What do you need it for?
Well, I already started learning PHP. I wanted to check my skills by making some simple website. In past, I had an idea to create website that would host Soldat's demos and screenshots to make sharing them easier. I created the code that uploads files on external free ftp accounts but I didn't know that accessing them will be so difficoult. So, if it's needed to download some file on main ftp server and then let the user to download it, it will take a lot of transfer that is limited. In fact, I hoped that you (the team) will be able to host main website (just to get some official good-looking url) if you think it's useful for community. But I know now my website is not so cool as long as it needs to download the file from external ftp before sharing it to the user.

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5037
Re: The 'Simple Questions' thread.
« Reply #1614 on: April 16, 2012, 11:05:42 pm »
Is it possible to get some file from external ftp server that has password we don't want to share and send it to user without downloading it on main website (where the user clicks download button). Would be nice to hide external ftp server's url but it's not so needed yet. Also, it might be impossible.

PHP's FTP client functions are easy enough to use - http://php.net/manual/en/book.ftp.php
There are other worlds than these

Offline machina

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1117
  • The world isn't nice. Why should I be...?
Re: The 'Simple Questions' thread.
« Reply #1615 on: April 17, 2012, 08:30:17 am »
PHP's FTP client functions are easy enough to use - http://php.net/manual/en/book.ftp.php
Yea, I know the referance. But I can't see there any function that would let me thing I wish to do...

Offline machina

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1117
  • The world isn't nice. Why should I be...?
Re: The 'Simple Questions' thread.
« Reply #1616 on: June 26, 2012, 10:13:50 am »
Need the software that would let me create every sound of guitar, drums, bass etc... And then put it on the timebar.

Offline Laser Guy

  • Veteran
  • *****
  • Posts: 1679
Re: The 'Simple Questions' thread.
« Reply #1617 on: July 14, 2012, 09:28:11 am »
Idk, FL Studio?
Text goes here...

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5037
Re: The 'Simple Questions' thread.
« Reply #1618 on: December 04, 2012, 01:49:34 am »
Can someone please tell me specifically what movie this is from? I'm sure it's one of the matrix sequels but I don't know which.
There are other worlds than these

Offline Vucgy92

  • Soldier
  • **
  • Posts: 221
  • cyklon-b is the only way
Re: The 'Simple Questions' thread.
« Reply #1619 on: December 04, 2012, 03:46:21 pm »
Would tip on Matrix 3 revolutions , The 1 matrix isn't it as I watched it few nights back also cause its my fav. I knew for it  ...
Choose one,
Bonecrusher