.htaccess help

Started on the old forum in October 2010 · view the original in the archive · old links redirect here

11 replies · 871 views · started 16 years ago · 1 min read

4 participants
shakil420 Developer · 125 posts #1

hi there i use free host but my hosting pannel doesnt support .htaccess files by the way i dont even need that.. here is my .htaccess

php_value date.timezone Europe/Dublin
php_flag register_globals on

without .htaccess my site runing good but i face problems

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY shtime DESC LIMIT 0, 6' at line 1

but when i use .htaccess it doesnot show any error pls tell me what is the meaning

php_value date.timezone Europe/Dublin
php_flag register_globals on

?????

CreativityKills Lead · 833 posts #2

Your coding is INSECURE and can be exploited or injected sumway through register_globals. When u turn it on, it registers a global, when u dont global request vars dnt register thus ur error.

shakil420 Developer · 125 posts #3

here is my error line code

$sql = "SELECT id, shout, shouter, shtime , shid FROM 420_shout WHERE shid='".$shid."' ORDER BY shtime DESC LIMIT $limit_start, $items_per_page";

why this code needs php_flag register_globals on ?? if i use it then no errors occured if not then error !! help me MGIGS bro

Added after 40 minutes:

thank u Mgigs bro i got the concept thanx a lot

something else Fellow · 2,296 posts #4

Your error is your not collecting the variable $shid (nothing is assigned to it) ... so you need something like this: $shid = $_GET['shid'];

shakil420 Developer · 125 posts #6

now another problem page next or previous option not working when i wanto see my shout history !!

khan Lead · 681 posts #7

All these problem occurs as because of your code is basically made for global registering and your server regs global is off. but if you turn it on your site is on in danger.

use all strng like someting_else writes. $code = $GET_['code'];

shakil420 Developer · 125 posts #9

What is global registering.i need basic idea to understand.

CreativityKills Lead · 833 posts #10
// Psedo code
if($_POST['password'] === 'foo')
{
 $authorized = TRUE;
}

if($authorized)
{
 echo 'logged in';
}
else
{
 echo 'logged out';
}

The code above doesnt look like its got any problems. But visiting http://site.com/file.php?authorized=1 with register globals on will log the user in, but with it off it wont. Basically i can assign values to vars with globals on. Bear in mind tho that the register_globals function is not insecure, its the user coding that is. With good coding practise, u can work with it on. Example

// Psedo code
$authorized = FALSE;

if($_POST['password'] === 'foo')
{
 $authorized = TRUE;
}

if($authorized === TRUE)
{
 echo 'logged in';
}
else
{
 echo 'logged out';
}

By defining variables first, you can be a tad safer. Bt generally, its nt worth getting stoned over, turning off global registering is waay easier.

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close