Jump to content

megetron

Members
  • Posts

    53
  • Joined

  • Last visited

    Never

Everything posted by megetron

  1. If in the new version of php object $_SESSION does a self register, so I can remove the session_register. according to your suggestion I have combined a new code (without changing php.ini ot .htaccess): <?php session_name("MySite"); session_start(); reset ($_GET); $USERCOOKIE_FOR_TRACKING = array(); //to get all session variables extract($_SESSION); // FOR NEW VERSION ?> it looks good and updated to the new version of php. Can you please review the code? this is a very important section as all of my website is using this file and tracking stuff. if my changes can harm other parts of my code please l would like to know what you think risks are. as for QA I am doing it right now. Thankl you guys!
  2. the script is included in many files that used by the softwre. the purpose of the script is to set the sessions, so it can be used in many places in the software as a global. I am not sure what $_GET is all about, but with _GET method I dont have any issues, so I will not change it in the meantime. I tried to disable this by the .htaccess file n many ways but the error still exist. But according to article I read, using session_register removed from php 4.2 because it is not secured, so I really need a security with my application and it is important for me to not stay behind in technology and security that php 5 offer. so I choose not to change the .htaccess file, and insead I would like to fix it so php5 will approve my code by default. what should I do to make this happen? Thank you for replies.
  3. Hello, I create tracking code file named "get_t.php". I call it using javascript: <script language='javascript' type='text/javascript'> var r=document.referrer; var counter = new Object(); counter.src = 'http://MyWebSite.com/get_t.php?aid=55&lid=F29&r='+r; </script><script src=http://MyWebSite.com/get_t.php?aid=55&lid=F29> </script> In this file all I do is to print "Hello World". Now, everything works fine most of the time. but sometimes the file does not executed for some reason, and empty page is displayed without showing message "Hello World". Please advice. Thanks,
  4. Hi, I have an old code from 2004 and I would like to update it to use new Session object. That means instead of session_register using the $_SESSION super global variable. The main reason for this change is that wheneve I logged out from the software I get: Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively in Unknown on line 0 Spo I replace my old code: <?php session_name("MySite"); session_start(); reset ($_GET); session_register("ADMIN"); session_register("ADMINNAME"); session_register("MAIL") ; $USERCOOKIE_FOR_TRACKING = array(); //to get all session variables foreach ($_SESSION as $key => $value) { $value=stripslashes(trim($value)); $$key=$value; } ?> with this new code: <?php session_name("MySite"); session_start(); reset ($_GET); $_SESSION['ADMIN']=""; $_SESSION['ADMINNAME']=""; $_SESSION['MAIL']=""; $USERCOOKIE_FOR_TRACKING = array(); //to get all session variables foreach ($_SESSION as $key => $value) { $value=stripslashes(trim($value)); $$key=$value; } ?> BUT now I cannot login to the software any more. looks like I am doing something wrong here. please tell me how do I upgrade my code. Thank you.
  5. Hi, I would like to add some advertisment banners the link to landing pages. in the regular webdevelopment I use cookies. how do I do it with mobile? does it support cookies? please enlight me. Thank you.
  6. I cant do this. I am working on speciel website which is already on production. what I need is a good component...
  7. Hi, why my query doesnt work and the order doesnt work. instead of ordering by a number its order by a string. here is query: $sql = " SELECT * FROM p_transaction AS t, p_joinpgm AS j,p_merchant as m"; $sql .= "where AND t_joinpgmid = '$joinid' AND t.t_joinpgmid = j.joinpgm_id AND j.joinpgm_merchantid=m.merchant_id order by t_id desc";
  8. Hi ppl, I am not an php expert, but I want to allow my website users to edit a record in mySQL table. I need to allow them changing Name and description of a product, thats all. easy edit. Is there a ready component that will do the hard work for me? Thank you!
  9. So, you are forcing the server to serve the PHP file as a HTML static file. You are getting the desired results that you asked for. If you want PHP parsed as PHP, then do not force the type to HTML. Thanks! but how do I php files on server to use UTF-8? Why did I change server and the charachters displayed badly?
  10. I struggle this for 24 hours this is frustrating.,.. The Hosting server says that I needs to change the code some how to add encoding support. I add the META tag for UTF-8, and saved the file as utf-8 and even used the header() tag to change php utf-8.... the only way to make encoding work is to change the utf-8...
  11. ok here is the issue, I added to my htaccess this lines: <Files "default.php"> ForceType 'text/html; charset=UTF-8' </Files> after I remove this, your suggestion is working. but now everything is encoded bad.,.. Here is the page: http://cf.affilinn.co.il/selanet/education please advise.
  12. now the output is this: <div class="wFormContainer" style="width:880px; background-image: url(<?php echo (empty($_GET['iswoman'])) ? 'l_banner1.jpg' : 'l_banner1_man.jpg';?>);background-color:#FFFFFF;background-repeat: no-repeat;margin:auto;">
  13. here is the output: <div class="wFormContainer" style="width:880px; background-image: url(<?(empty($_GET['iswoman'])) ? 'l_banner1.jpg' : 'l_banner1_man.jpg';?>);background-color:#FFFFFF;background-repeat: no-repeat;margin:auto;">
  14. Hi, I haveof issues regarding encoding. in my old hosting server I had none. To enforce the server to use utf-8. looks like the server use another encoding, so this is my htaccess file: <FilesMatch "\.(htm|html|css|js)$"> ForceType 'text/html; charset=UTF-8' </FilesMatch> <Files "default.php"> ForceType 'text/html; charset=UTF-8' </Files> <Files "emailvalidate.php"> ForceType 'text/html; charset=UTF-8' </Files> When I try to execute emailvalidate.php I get a strange behaviour. here is the output: connection($host,$user,$pass,$db); if((!isset($B1))and($flag=="0")) { // form auto submitted by List $event = $eventcompo; if($event=="ChooseEvent") { $msg="Please select an Event! "; $_SESSION['BODY']=""; $_SESSION['HEADER']=""; $_SESSION['FOOTER']=""; } $_SESSION['BODY']=""; $_SESSION['HEADER']=""; $_SESSION['FOOTER']=""; $sql="SELECT * FROM partners_adminmail, partners_event WHERE partners_adminmail.adminmail_eventname = partners_event.event_name AND partners_adminmail.adminmail_eventname = '$event' "; $res=mysql_query($sql); while($row = mysql_fetch_object($res)) { $from=$row->adminmail_from; $sub=$row->adminmail_subject; $_SESSION['BODY']=$row->adminmail_message; $_SESSION['HEADER']=$row->adminmail_header; $_SESSION['FOOTER']=$row->adminmail_footer; $status=$row->event_status; } $msg=""; header("Location:index.php?Act=email&from=$from&sub=$sub&header=$header&body=$body&footer=$footer&event=$event&status=$status&msg=$msg&to=$to"); exit; } if((isset($B1))or($flag=="1")) { // echo "submitted from button"; $event = $eventcompo; $from =trim($fromtxt); $sub =trim($subjecttxt); $body =trim($bodytxt); $header =trim($headertxt); $footer =trim($footertxt); $getst =$statusradio; $_SESSION['HEADER']=$header; $_SESSION['BODY']=$body; $_SESSION['FOOTER']=$footer; if ($getst=="active") { $status="yes"; } else { $status="no"; } } // validations if(empty($from)) $err = "1"; else $err = "0"; if(empty($sub)) $err .= ".1"; else $err .= ".0"; if(empty($header)) $err .= ".1"; else $err .= ".0"; if(empty($body)) $err .= ".1"; else $err .= ".0"; if(empty($footer)) $err .= ".1"; else $err .= ".0"; if($err!="0.0.0.0.0") { $msg="Invalid Entry...Please do not empty any fields"; $_SESSION['HEADER']=$header; $_SESSION['BODY']=$body; $_SESSION['FOOTER']=$footer; header("Location:index.php?Act=email&from=$from&sub=$sub&event=$event&status=$status&msg=$msg&to=$to"); exit; } if($event=="ChooseEvent") { $msg="Please select an Event! "; header("Location:index.php?Act=email&from=$from&sub=$sub&event=$event&status=$status&msg=$msg&to=$to"); exit; } if($from != '[from]') { if(!$partners->is_email($from)) { $msg="From field should be a valid E-mail Id ! "; header("Location:index.php?Act=email&from=$from&sub=$sub&event=$event&status=$status&msg=$msg&to=$to"); exit; } } ////////////// test sending if ($flag=="1") { if(!$partners->is_email($to)) { $msg="Please Enter a valid E-mail Id on Test Field !!"; header("Location:index.php?Act=email&from=$from&sub=$sub&event=$event&status=$status&msg=$msg&to=$to"); exit; } $sql_admin="select * from partners_admin"; $res_admin=mysql_query($sql_admin); $row_admin =mysql_fetch_object($res_admin); //common header and footer $adminheader=stripslashes($row_admin->admin_mailheader); $adminfooter=stripslashes($row_admin->admin_mailfooter); $admin_email = stripslashes($row_admin->admin_email); $today =date("Y-m-d"); /////////// mail sending $headers = "Content-type: text/html; charset=UTF-8\n"; $headers .= "From: $from\n"; $headers =str_replace("[from]",$admin_email,$headers); $body1=" "; $body1.=" "; $body1.=" "; $body1.=" "; $body1.=" "; $body1.=" $adminheader "; $body1.=" "; $body1.=" "; $body1.=" $header "; $body1.=" "; $body1.=" "; $body1.=" "; $body1.=" "; $body1.=" "; $body1.=" $body"; $body1.=" "; $body1.=" "; $body1.=" "; $body1.=" "; $body1.=" "; $body1.=" $footer "; $body1.=" "; $body1.=" "; $body1.=" $adminfooter "; $body1.=" "; $body1.=" "; $body1.=" "; $body1.=" "; $body1.=" "; //Replace variable in the content with values $body1=str_replace("[aff_firstname]","Affiliate FirstName",$body1); $body1=str_replace("[aff_lastname]","Affiliate LastName",$body1); $body1=str_replace("[aff_company]","Affiliate Company",$body1); $body1=str_replace("[aff_email]","Affiliate Email",$body1); $body1=str_replace("[aff_loginlink]","Affiliate Url",$body1); $body1=str_replace("[aff_password]","Affiliate Password",$body1); $body1=str_replace("[mer_firstname]","Merchant FirstName",$body1); $body1=str_replace("[mer_lastname]","Merchant Lastname",$body1); $body1=str_replace("[mer_company]","Merchant Company",$body1); $body1=str_replace("[mer_email]","Merchant Email",$body1); $body1=str_replace("[mer_loginlink]","Merchant Url",$body1); $body1=str_replace("[mer_password]","Merchnat Password",$body1); $body1=str_replace("[from]",$admin_email,$body1); $body1=str_replace("[commission]","Commission Earned",$body1); $body1=str_replace("[program]","Program Name",$body1); $body1=str_replace("[type]","Transaction type",$body1); $body1=str_replace("[date]","Transaction Date",$body1); $body1=str_replace("[today]",$today,$body1); mail($to,$sub,$body1, $headers); $msg="Mail has been send to ".$to; header("Location:index.php?Act=email&from=$from&sub=$sub&event=$event&status=$status&msg=$msg&to=$to"); exit ; } ////////////// updating table $sql="select * from partners_adminmail WHERE adminmail_eventname='$event'"; $res=mysql_query($sql); if(mysql_num_rows($res)>0) { $sql1="UPDATE partners_adminmail SET adminmail_from ='$from',adminmail_subject='".addslashes($sub)."',adminmail_header='".addslashes($header)."',adminmail_footer='".addslashes($footer)."',adminmail_message='".addslashes($body)."' WHERE adminmail_eventname='$event'"; $sql2="UPDATE partners_event SET event_status ='$status' WHERE event_name='$event'"; $res=mysql_query($sql1) or die ("cant exe"); $res2=mysql_query($sql2) or die ("cant exe 2 nd"); $msg="Message updated "; header("Location:index.php?Act=email&from=$from&sub=$sub&event=$event&status=$status&msg=$msg&to=$to"); } else { $sql1="INSERT INTO partners_adminmail ( adminmail_id , adminmail_eventname , adminmail_from , adminmail_subject , adminmail_message , adminmail_header , adminmail_footer ) VALUES ('', '$event', '$from', '".addslashes($sub)."', '".addslashes($body)."', '".addslashes($header)."', '".addslashes($footer)."')"; $sql2="UPDATE partners_event SET event_status ='$status' WHERE event_name='$event'"; $res=mysql_query($sql1); echo mysql_error(); $res2=mysql_query($sql2) ; echo mysql_error(); $msg="Message updated "; header("Location:index.php?Act=email&from=$from&sub=$sub&event=$event&status=$status&msg=$msg&to=$to"); } ?>
  15. hi, I need a code that switch the background of a stylesheet according to url parameter. I am using this (it wont work): <div class="wFormContainer" style="width:880px; background-image: url(<?(empty($_GET['iswoman'])) ? 'l_banner1.jpg' : 'l_banner1_man.jpg';?>);background-color:#FFFFFF;background-repeat: no-repeat;margin:auto;"> please help
  16. Hi, I have a file with a .js extension (I dont want to change the extensions because of other issues I have, wich are for another thread ). in this .JS file I want to execute some php commands. actually I want to generate using php a .js file. How do I do that?
  17. Hello, I am using horizon-host.com as my hosting web server. The problem is that it generetes statistics for each page. Can I disable this for some of the pages or else disable for all files?
  18. please ignore "Response.Write"...my mistake. the full code is this: <?echo "document.write(\"Hello World\");";?> Here you have a link to the file (I rename the file to "get_trackingcode1.php") http://affilinn.co.il/get_trackingcode1.php?aid=1&linkid=N1 I expect to see "Hello World" text when calling the page using javascript.
  19. Oops..I meant: echo "document.write(\"Hello World\");";
  20. Hello all, I am trying to create a link tracker. I created a javascript file : trackincode.php?lid=1 and in it this line: Response.Write("document.write(\"Hello World\");"); Now, I want to call this file from an HTML file, so I copy/paste this HTML: <script language='javascript' type='text/javascript'> var r=document.referrer; var counter = new Object(); counter.src = 'http://domain.com/trackingcode.php?lid=7&r='+r; </script><script src=http://domain.com/trackingcode.php?lid=7> </script> unfortunattly the code does not display the text "Helloo World" and the file is not executed... Any suggestions? NOTE: I know this code works on another servers...
  21. hello, I host my website on a linux server, but when I click this code: mail($to,$sub,$body1, $headers); it does not send any mail. I dont get any error also. I know that it worked on other servers. what should I do? thanks
  22. what this line means: $USERCOOKIE_FOR_TRACKING = array(); does it create a new empty array?
  23. <?php session_start(); session_register("CRMMERCHANT"); session_register("ADMIN"); session_register("ADMINNAME"); session_register("MAIL"); session_register("MERCHANT"); session_register("AFFILIATE") ; session_register("HEADER") ; session_register("BODY") ; session_register("FOOTER") ; session_register("msg") ; session_register("res") ; session_register("SESSIONSTATUS"); session_register("JOINSTATUS"); session_register("MERCHANTID"); session_register("AFFILIATEID") ; session_register("PROGRAMID") ; session_register("DES") ; session_register("LINKS") ; session_register("PGMID") ; session_register("MAILAMNT") ; session_register("MAILHEADER") ; session_register("MAILFOOTER") ; session_register("TRANS_MERCHANTID"); session_register("BANNERCODE") ; session_register("VAR"); session_register("SORTINGTABLE") ; session_register("MER_SORTINGTABLE") ; session_register("CAT_SORTING") ; session_register("LANGUAGE") ; session_register("MERCHANTNAME") ; session_register("PAYMODE") ; session_register("MERCHANTBALANCE"); session_register("AFFILIATENAME") ; session_register("AFFILIATEBALANCE"); session_register("ADMINLASTLOGGEDIP"); session_register("USERRETRIEDCOUNT"); session_register("ADMINUSERID"); session_register("DEFAULTCURRENCYSYMBOL"); session_register("AFF_ADDRESS"); session_register("MER_ADDRESS"); session_register("AFFILIATE_REFERER_ID"); $USERCOOKIE_FOR_TRACKING = array(); //to get all session variables foreach ($_SESSION as $key => $value) { $value=stripslashes(trim($value)); $$key=$value; } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.