Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Does my code look right?

Featured Replies

Hi,

 

Having a few problems with this chunk of code stops page loading, but when removed it works, or when user is logged it it works.

 

if ( $_GET[sssess] )
{
   session_id( $_GET[sssess] );
}
session_start( );

if ( isset( $_GET[redeempoints] ) && $_GET[redeempoints] == "Y" )
{
   $_SESSION[redeemer] = "Y";
}
if ( $_POST[purchaseorder] )
{
   $_SESSION[po] = "{$_POST['purchaseorder']}";
}
if ( !$_SESSION[loginemail] )
{
   $_SESSION[loginemail] = "noemail";
}
if ( !$_SESSION[adminemail] )
{
   $_SESSION[adminemail] = "noemail";
}
if ( $_POST[discode] )
{
   $_SESSION[discode] = trim( "{$_POST['discode']}" );
}
$auth_ok_check = md5( "{$_SESSION['loginemail']}.{$hash}" );
$admin_ok_check = md5( "{$_SESSION['adminemail']}.{$hash}" );
if ( isset( $_GET['oidref'] ) )
{
   $GLOBALS['_GET']['oidref'] = mysql_real_escape_string( $_GET['oidref'] );
   $sql = "SELECT o_id FROM order_list WHERE ref='".$_GET['oidref']."' AND unh='{$_GET['oidref']}'";
   if ( !( $result = @mysql_query( $sql, $connection ) ) )

   if ( $row = mysql_fetch_array( $result ) )
   {
       $_SESSION['unh'] = $_GET['oidref'];
       header( "location: ".$sshopurl."orderdetails_os.php?o_id={$row['o_id']}" );
       exit( );
   }
   if ( $_SESSION['auth_ok'] == $auth_ok_check )
   {
       header( "location: ".$sshopurl."secure/orders.php" );
       exit( );
   }
   header( "location: ".$sshopurl."secure/login.php?next=orders.php" );
   exit( );
}
if ( preg_match( "/secure/", "{$_SERVER['PHP_SELF']}" ) && !preg_match( "/doqreg.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/qreg.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/voicepaycallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/secpaysecpagecallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/vps_handle_protx_response.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/protx/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/protxformcallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/protxcallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/worldpaycallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/securetradingcallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/barclayscpicallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/paypalcallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/moneybookerscallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/nochexcallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/offlinecallback.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/doregister.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/register.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/doprereg.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/login.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/dologin.php/", "{$_SERVER['PHP_SELF']}" ) )
{
   if ( $auth_ok_check != $_SESSION[auth_ok] )
   {
       header( "Location: ".$sshopurl."secure/login.php?next={$_GET['next']}&shk&p={$_SERVER['PHP_SELF']}" );
       exit( );
   }
   if ( preg_match( "/secure/", "{$_SERVER['PHP_SELF']}" ) )
   {
       $isaccount = "1";
   }
}
if ( preg_match( "/".$adminDir."/", "{$_SERVER['PHP_SELF']}" ) && !preg_match( "/adlogin.php/", "{$_SERVER['PHP_SELF']}" ) || !preg_match( "/forgetful.php/", "{$_SERVER['PHP_SELF']}" ) )
{
   if ( $admin_ok_check != $_SESSION[admin_ok] )
   {
       header( "Location: ".$adminurl."adlogin.php" );
       exit( );
   }
   if ( preg_match( "/".$adminDir."/", "{$_SERVER['PHP_SELF']}" ) )
   {
       $isadmin = "1";
   }
}
$noadirs = count( $admin_dirs );
$i = 0;
for ( ; $i <= $noadirs; ++$i )
{
   if ( !preg_match( "/admin\\/".$admin_dirs[$i]."/", "{$_SERVER['PHP_SELF']}" ) && preg_match( "/".$admin_dirs[$i]."/", "{$_SESSION['admin_type']}" ) )
   {
       continue;
   }
   header( "Location: ".$adminurl."perms.php?noperm={$admin_dirs[$i]}" );
   exit( );
}
if ( !$_SESSION[shopper_type] )
{
   $_SESSION[shopper_type] = "1";
}
if ( $_GET[setcurrency] == 1 )
{
   if ( $_GET[new_currency_id] )
   {
       $GLOBALS['_POST'][new_currency_id] = $_GET[new_currency_id];
   }
   $_SESSION['currency_id'] = $_POST[new_currency_id];
}
if ( $_GET[clearptid] == Y )
{
   session_unregister( "ptid" );
}
if ( $_GET[selectpostage] == 1 )
{
   if ( $_POST[selptid] == Free || $_POST[selptid] == free )
   {
       session_unregister( "ptid" );
   }
   else if ( isset( $_POST[selptid] ) )
   {
       $_SESSION['ptid'] = $_POST[selptid];
   }
   else
   {
       session_unregister( "ptid" );
   }
   $GLOBALS['_POST'][selptid] = mysql_real_escape_string( $_POST[selptid] );
   $sql1 = "UPDATE basket SET ptid='".$_POST['selptid']."' WHERE session_id='".session_id( )."'";
   if ( !( $result1 = @mysql_query( $sql1, $connection ) ) )
   {
       exit( "Couldn't execute request 1" );
   }
}

 

 

 

Thanks

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.