Jump to content

Hit Counter

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
Ryan

Ryan

    Newbie

  • Members
  • Pip
  • 3 posts
recently i wrote a hit counter using php and sql and the gd lib

Click

If you somehow find a way to break it tell me how you did it :)

and im in in need of a regex for a name field like this
"firstname lastname";

#2
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts

Ryan said:

and im in in need of a regex for a name field like this
"firstname lastname";
What do you want to do with it? Simply extract "firstname," and "lastname," into two separate variables? If so, then there's no need for regular expressions.
$Fullname     = "firstname lastname";
$NameSplitted = explode(' ', $Fullname);
$Firstname    = $NameSplitted[0]; // firstname
$Lastname     = $NameSplitted[1]; // lastname
You've to modify the code of course. You'll have to check whether the user has more than one firstname (or lastname) and such things.

#3
Guest_Jaan_*

Guest_Jaan_*
  • Guests
if you have both names in one textbox then maybe users wont enter their lastname so that means you will not get their lastname.. so i suggest you to make 2 textboxes :)

#4
Ryan

Ryan

    Newbie

  • Members
  • Pip
  • 3 posts

Jaan said:

if you have both names in one textbox then maybe users wont enter their lastname so that means you will not get their lastname.. so i suggest you to make 2 textboxes :)

ok thanks to both of you :)

#5
Guest_Jaan_*

Guest_Jaan_*
  • Guests
no problemo

#6
Lop

Lop

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,172 posts
I created a user: test@test.com / test
and received:


Warning: mysql_result(): link_url not found in MySQL result index 2 in /home/content/r/y/a/ryanfanshaw/html/omfg/count3.0/mysql.php on line 89

Warning: mysql_result(): link_url not found in MySQL result index 2 in /home/content/r/y/a/ryanfanshaw/html/omfg/count3.0/mysql.php on line 89

Warning: mysql_result(): link_url not found in MySQL result index 2 in /home/content/r/y/a/ryanfanshaw/html/omfg/count3.0/mysql.php on line 89

Warning: mysql_result(): link_url not found in MySQL result index 2 in /home/content/r/y/a/ryanfanshaw/html/omfg/count3.0/mysql.php on line 89

Warning: mysql_result(): link_url not found in MySQL result index 2 in /home/content/r/y/a/ryanfanshaw/html/omfg/count3.0/mysql.php on line 89

Warning: mysql_result(): link_url not found in MySQL result index 2 in /home/content/r/y/a/ryanfanshaw/html/omfg/count3.0/mysql.php on line 89

Warning: mysql_result(): link_url not found in MySQL result index 2 in /home/content/r/y/a/ryanfanshaw/html/omfg/count3.0/mysql.php on line 89

Also, every time I hit reload the counter increases. You should consider adding IP information so that each browser can only give a +1 count per day or hour.