Jump to content

newbornultra

New Members
  • Posts

    6
  • Joined

  • Last visited

newbornultra's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi there, I am having a little trouble with a hyperlink containing a query string to another site. On Chrome, it is recognised as a $_GET parameter, but it seems on the others (Firefrox/Safari/IE) it doesn't seem to be picking query string. if (isset($_REQUEST['q'])) { $rUrl=$_SERVER["HTTP_REFERER"]; echo "<pre>"; echo $rUrl; $url=parse_url($rUrl); $host=$url['host']; echo "</pre>"; } else { echo "<pre>"; var_dump($_REQUEST); echo "</pre>"; } and my test page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Untitled Document</title></head> <body><a href="http://domain.com/?q=puXs543543fi7654645n-baztbb65Kim9ra2KDX6F-nnu3z4crnpqFra67IiO54645qFh7iA">Link</a></body></html>
  2. Hi, I have to center a div in an absolute parent div. The usual suspect giving a width and adding margin:0 auto doesn't work. It "sorta" works if I put left:25% in the div I'm trying to center, but it doesn't adjust if I resize the screen. How do I do this? <div id="rest"> <div class="wrap-reset"> some content in center.. </div> </div> .wrap-reset { width:960px; position:relative; margin:0px; } #rest { position:absolute; top:0px; } Thanks,
  3. Hello, I have a dropdown menu, which has a strange flicker effect when you first hover over it. If you hover over it afterwards then the effect doesn't happen. It seems to occur in Chrome and IE. #nav1 { padding:0px; list-style-type:none; } #nav1 li { float:left; width:156px; height:auto; } #nav1 li a { display:table-cell; width:143px; background-image:url(../images/hcp-main.jpg); height:105px; color:#ffffff; font-size:16px; vertical-align:middle; text-align:center; font-weight:bold; text-decoration:none; } #nav1 li a:hover { background-image:url(../images/hcp-hover.jpg); } #nav1 li ul { padding:0px; list-style-type:none; } #nav1 li ul li a { font-size:12px; font-weight:normal; display:table-cell; vertical-align:middle; text-align:left; padding-left:7px; width:129px; padding-right:7px; } #nav1 li ul li.crohns { height:29px; width:143px; } #nav1 li ul li.ra { height:29px; width:143px; } #nav1 li ul li.ps { height:42px; width:143px; } #nav1 li ul li a.crohns { margin:0px; background-image:url(../images/crohns-a.jpg); height:29px; width:129px; } #nav1 li ul li a.crohns:hover { margin:0px; background-image:url(../images/crohns-ahover.jpg); height:29px; width:129px; } #nav1 li ul li a.ra { margin:0px; background-image:url(../images/ra-a.jpg); height:29px; width:129px; } #nav1 li ul li a.ra:hover { margin:0px; background-image:url(../images/ra-ahover.jpg); height:29px; width:129px; } #nav1 li ul li a.ps { margin:0px; background-image:url(../images/ps-a.jpg); height:42px; width:129px; } #nav1 li ul li a.ps:hover { margin:0px; background-image:url(../images/ps-ahover.jpg); height:42px; width:129px; } <ul id="nav1"> <li><a href="#">Patient</a> <ul> <li class="crohns"><a class="crohns" href="index.html">Crohn's Disease</a></li> <li class="ra"><a class="ra" href="index.html">Rheumatoid Arthritis</a></li> <li class="ps"><a class="ps" href="index.html">Psoriasis / <br /> Psoriatic Arthritis</a></li> </ul> </li> <li><a href="index.html">Healthcare Professional</a></li> </ul> Any ideas what's causing it? Background images are jpg's so it isn't a PNG issue Thanks,
  4. Okay.. here's a var dump of an array. array(30) { [0]=> int(0) [1]=> int(0) [2]=> int(0) [3]=> int(0) [4]=> int(0) [5]=> int(0) [6]=> int(0) [7]=> int(0) [8]=> int(0) [9]=> int(0) [10]=> int(0) [11]=> int(0) [12]=> int(0) [13]=> int(0) [14]=> int(0) [15]=> int(0) [16]=> int(0) [17]=> int(0) [18]=> int(0) [19]=> int(0) [20]=> int(0) [21]=> int(0) [22]=> int(0) [23]=> int(0) [24]=> int(0) [25]=> int(0) [26]=> int(0) [27]=> int(0) [28]=> int(0) [29]=> int(0) } I want to get the value of the array element.. this is a snippet of my code: $valueInArray=(date('j',strtotime($value))-1).'<br>'; $cValueInArray=$datesInMonth[$valueInArray]; But when I execute it, I am getting a undefined index. Notice: Undefined index: 18 Notice: Undefined index: 14 Notice: Undefined index: 20 So in a nutshell for the first undefined index.. I am looking to get the value of datesInMonth array- element 18. Hope this makes sense now Edit: Fixed. I forgot to remove my '<br>' tags when debugging.
  5. Hello, I have created an array for every day of a month. Eg, Element 0 is Day 1 etc, so there can be in theory 28 -31 elements depending on the month. The values of each element are set to 0. I am looking to add increment the value of a day if the present element is 15 minutes or more before the previous access. I have had a go at this and I get this error: Notice: A non well formed numeric value encountered for ($i=0;$i<sizeOf($newList);$i++) { //echo $newList[$i]->ip." "; if (($newList[$i]->ip)==$prevIp) { if ($i>0) { $minutes_to_add = 15; $time = new DateTime($newList[$i-1]->time); $time2=$time; $time2->add(new DateInterval('PT' . $minutes_to_add . 'M')); $stamp = $time2->format('Y-m-d H:i:s'); $iTime=new DateTime($newList[$i]->time); $interval=date_diff($time,$iTime); if ($interval->format('%i')>$minutes_to_add) { $value=$newList[$i]->time; //echo $value; echo $datesInMonth[(int)(date('j',$value)-1)]; //$oldValue=$datesInMonth[(date('j',$iTime[$i]->time)-1)]; //$newValue=$oldValue+1; //$datesInMonth[(date('j',$iTime[$i]->time)-1)]=$newValue; } } } $prevDate=$newList[$i]->time; $prevIp=$newList[$i]->ip; } Any ideas how to solve? Cheers,
  6. Hi, in essence I am outputting some information into a Excel file. But I am stuck on how to sort some an array first by IP, and then within each IP sort it by date. I am pulling this information from a MySQL database, and adding it to an array of stfclass. $newListDetails=new StdClass; $newListDetails->topic=$row['topic_title']; $newListDetails->cat=$row['cat_name']; $newListDetails->ip=$row['ip_remote']; $newListDetails->search=$row['search']; $newListDetails->time=$row['time']; $newList[]=$newListDetails; And I am sorting them by IP like this: function sortByIp($a, $B){ return strcmp($a->ip, $b->ip); } usort($newList, 'sortByIp'); var_dump($newList); So it's grouping the IPs like I expect it to, but now I need to sort them by date within each IP. Does anyone have any ideas how to do that? Thanks,
×
×
  • 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.