Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. 🚫 No AI-generated (LLM) posts allowed. Share your own thoughts and experience — accounts may be terminated for violations.

PHP advice needed

Status
Not open for further replies.
Joined
Feb 10, 2014
Posts
10
Reaction score
0
Hiya :)

I need to install an image tracking pixel on my sites "thank you" page for one of our affiliates.

I'll be passing variables through the url to this page that need to be included ie www.mysite.com/?SUBID=21&LEADID=55&Opt=yes

Can I use GET in this way and would this work? ...

echo '<img src='https://www.imagepixel.com/tracking/RecordPixel.aspx?cmp=38721&optional=". $_GET["LEADID"] ."&optional2=". $_GET["SUBID"] ."&optional3=". $_GET["Opt"] ." width="1" height="1" border="0"'>';


Thanks in advance for any advice. Much appreciated :)
 
Last edited:
Never, use raw url data like that though. Make sure it's sanitised.

The filter input functions in php are good. Some variables can be typecast to a type e.g. integer.

If you're using a cms like wordpress then that has sanitization tools built in.

Anything that is going to touch a database query needs it.
 
Are you putting the data into a database? I always track any visit locally. If so you can use echo '<img src='https://www.imagepixel.com/tracking/RecordPixel.aspx?cmp=38721&optional=". mysql_real_escape_string($_GET["LEADID"]) ."&optional2=". mysql_real_escape_string($_GET["SUBID"] )."&optional3=".mysql_real_escape_string( $_GET["Opt"]) ." width="1" height="1" border="0"'>';

This sanitizes the $_GET vars for slashes and any mysql injections when you're passing them through. Note it won't change them though so you'll need to run the same function on the $_GET vars before passing them into a database. You might want to go further and remove other things you wouldn't want to pass through.
 
Status
Not open for further replies.

Rule #1: Be Respectful

Do not insult any other member. Be polite and do business. Thank you!

Premium Members

New Threads

Domain Forum Friends

Lastest Listings

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Siusaidh AcornBot:
    Siusaidh has left the room.
      Siusaidh AcornBot: Siusaidh has left the room.
      Top Bottom