/    Sign up×
Community /Pin to ProfileBookmark

Looking for a certain constant.

Looking for the constant that contains the path to the page that referred the client(the last page the client visited). I want to use in to verify that the client applies from the form that i provided,
Thanks in advance!.
Also can some one advice me which functions check the type of variable
so i can verify that all the chars are alpha-normal and that the user don’t trying any injections…

to post a comment
PHP

9 Comments(s)

Copy linkTweet thisAlerts:
@SpectreReturnsJan 05.2006 — $_SERVER["HTTP_REFERER"]. However, this is not accurate, so you should not depend on it.
Copy linkTweet thisAlerts:
@HellgYauthorJan 06.2006 — Can some one please assist me with the second matter?.
Copy linkTweet thisAlerts:
@chazzyJan 06.2006 — you could take a look at regular expressions...
Copy linkTweet thisAlerts:
@UbikJan 06.2006 — You can use the htmlspecialchars() function to code inserted data into your db, which [I]mostly[/I] takes care of SQL injection attacks.
Copy linkTweet thisAlerts:
@NogDogJan 06.2006 — If using MySQL:
[code=php]
// make text safe for MySQL database insert/update:
function sanitize_input($input)
{
if(get_magic_quotes_gpc())
{
$input = stripslashes($input);
}
return(mysql_real_escape_string($input));
}
[/code]
Copy linkTweet thisAlerts:
@bokehJan 07.2006 — (the last page the client visited).[/QUOTE]$_SERVER["HTTP_REFERER"]. [/QUOTE]$_SERVER["HTTP_REFERER"] doesn't necessarilly contain "the last page the client visited". It should, (but may not,) contain the reffering page. In the majority of cases that is the loaded page and not the previous page.
Copy linkTweet thisAlerts:
@SpectreReturnsJan 08.2006 — In the majority of cases that is the loaded page and not the previous page.[/QUOTE] Why's that? Isn't the referer where you came from?
Copy linkTweet thisAlerts:
@HellgYauthorJan 08.2006 — If a certain error occurs and the page is unavailable, and the user choose to recover the data that was sent to the form, the variable will contain NULL value...
Copy linkTweet thisAlerts:
@bokehJan 08.2006 — Why's that? Isn't the referer where you came from?[/QUOTE]Not necessarilly! For example, in the case of images, css, swf, and js files it is the html file that is currently being viewed, i.e. the referer.
×

Success!

Help @HellgY spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.22,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...