Category: Code

Three ways to debug php 0

Three ways to debug php

Method 1 – error.log For this to work you need to be coding in a linux environment with php, apache etc setup. This is the best way I have found and what I currently use to debug my applications/web pages. open up a new terminal and type: tail -f /var/log/apache2/error.log This will give you a readout of the last few error messages. Refresh the page you are working on in...

list to php array list2phparray 0

list to php array list2phparray

Code below for a script to take a list and turn it into an array. Comes in pretty useful. <?php if ($_POST[‘list’]) { $splist = explode(“\n”, $_POST[‘list’]); $out = ‘$x = array(‘; foreach ($splist as $line) { $out = $out.”‘$line’, “; } $out = substr($out,0,-1); $out = substr($out,0,-1); $out = $out.’);’; echo $out; } else { echo ‘<html><body>’; echo ‘<h1>List 2 php array</h1>’; echo ‘<form action=”list2phparray.php” method=”post”> <textarea cols=”100″ rows=”30″...

0

Prosper202 Hacks and Modifications

JiM’s Prosper202 mods 1) increase session life (stops it locking you out every few minutes) add the following line just before session_start(); in 202-config/connect.php ini_set(‘session.gc_maxlifetime’,99999); 2) Cchange the first page you see. edit 202-login.php line 80: header(‘location: /202-account’);  to   header(‘location: /tracking202’); or /tracking202/spy/ If you are doing email submits or any volume loging into spy is about as helpful as a kick up the arse so just change it to...

0

Dynamically modifying the landing page with TrafficVance using php

I ran into a silly issue today when dynamically modifying a landing page using TrafficVance. The script I was using was a pretty straight forward: <?php if ($_GET[‘t202kw’]) { $kw = strip_tags($_GET[‘t202kw’]); } if(strpos($kw,’jetinternetmarketing.co.uk’) !== false) { $page = ‘<h1>Dont target JiM on traffic Vance</h1>’; } ?> The problem was that the url I was using in Traffic Vance was http://www.jetinternetmarketing.co.uk/lander.php?t202kw={KeyWord} my target for example was: jetinternetmarketing.co.uk The script wasnt...