Jump to content

vesper8

Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

vesper8's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hey thanks ill check it out!! i also found getcwd() which sorta does the job.. but your solution might be even simpler. cheers!
  2. Hey all. My website is very dynamic and I reuse the same code in many different areas of it. I'm translating my site so it has both french and english and I want to re-use the same code but add conditionnals in my code so it displays text in the right language. The way I decided to do this was to simply check the parent folder. IE if parent directoryis /en/ then it will display in english and if parent directory is /fr/ it'll display in french.. you get the idea. But I don't know how to make comparisons on the parent directory based on the script's current location. And also.. would this also work if the folder I want to check is two folders down? IE if I'm /public_html/en/html/ <-- here and want to make a check on the /en/ could i still do it? and how would I ? thanks in advance
  3. Hey all.. sorry if the topic title looks misleading.. perhaps I'm not completely sure how to formulate this question properly ;p I'm new to arrays you see so I may of done this a bit weirdly.. but it does work.. without the sorting part. Here's my code [code] <table style="font-family:Verdana,Arial;font-size:10px;color:black;" width="570px"> <tr align="center"> <td><b style="color:white;">Ligue</td> <td><b style="color:white;">Nombre d'équipes</td> <td><b style="color:white;">Moyenne des cotes</td> </tr> <? $regionsRS = $db->execute("SELECT DISTINCT RegionID FROM equipes WHERE ClassID=".$ClassID); $y = $regionsRS->getNumOfRows(); $filterStr="0"; for ($j=0;$j<$y;$j++){ $filterStr=$filterStr.",".$regionsRS->fields["RegionID"]; $regionsRS->nextRow(); } $requete="SELECT * FROM tblRegions WHERE ID IN (".$filterStr.") ORDER BY Name"; $regionsRS = $db->execute($requete); $y = $regionsRS->getNumOfRows(); for ($j=0;$j<$y;$j++){ $requete="SELECT Count(ID) as nbTeams, sum(cote) as totalCote FROM equipes WHERE RegionID = ".$regionsRS->fields["ID"]." AND ClassID=".$ClassID; $countRS = $db->execute($requete); $moyLig_array[$j][0]=$regionsRS->fields["Name"]; $moyLig_array[$j][1]=$countRS->fields["nbTeams"]; $moyLig_array[$j][2]=round($countRS->fields["totalCote"]/$countRS->fields["nbTeams"],1); $regionsRS->nextRow(); } // end for sort($moyLig_array); for ($j=0;$j<$y;$j++){ if ($bgColor!="#efefef"){ $bgColor="#efefef"; }else{ $bgColor="#ffffff"; } ?> <tr align="center" style="cursor:hand;" onClick="location.href='categories.php?ClassID=<? echo $ClassID;?>&RegionID=<? echo $regionsRS->fields["ID"];?>';"> <td bgcolor="<? echo $bgColor;?>"><? echo $moyLig_array[$j][0]; ?></td> <td bgcolor="<? echo $bgColor;?>"><? echo $moyLig_array[$j][1]; ?></td> <td bgcolor="<? echo $bgColor;?>"><? echo $moyLig_array[$j][2]; ?></td> </tr> <? $regionsRS->nextRow(); } // end for ?> </table> [/code] Basically.. I made what I'm going to call an array.. although it's really more like a table.. Each row is divided into 3 columns. The 3rd column contains a float value. And I'd like to sort my table/array on that float value before I echo it out in my table. Could anyone be so kind as to show me how to do this please? Thanks much!
  4. well heh... i am so blind.. i just found the darn 'put online' button... *sad* anyway that takes care of the 'server offline' problem but alas it still doesn't work.. I'm listing on port 80 in the httpd.conf and i've forwarded both tcp/udp port 80 to my local ip.. and still nothing what's wrong ? =\
  5. Hey all.. believe me.. I've tried everything I can think of before I came and posted this question. I can see that this is a very popular topic.. but reading other's questions did lead me to try new things but none of them worked. It's probably something really stupid I'm missing but.. hopefully you can put an end to this headache. All i'm trying to do is set up a apache server so I can host a small website for school from my computer. I installed the latest version of WAMP5. i put my site files in wamp/www/ and I tested it with localhost and that works fine I notice when I start wamp it says 'all services running - server offline' i'm starting to think it shouldn't be saying server offline there.. because that might mean it's ONLY gonna allow the site to be viewed from localhost no matter what I put in there... anyway.. I have a buffalo airstation wireless router. Though this computer is connected to it via a RJ-45 cable. At first I was using DHCP but after reading in this forum I changed both computers to use static IPs and I disabled the router's DHCP.. Everything works fine as before (internet and all). I then tried to forward port 80 to this machine's IP.. I tried forwarding other ports as well and changing the port that apache listens to in httpd.conf I tried specifying the IP apache listens to instead of just the port and I set it to this computer's IP (the one with apache on it). well nothing works. Whenever I try to access the site via my router's dynamic address.. I just get prompted for my router's login/password and it logs me onto it.. It doesn't seem to want to get past it but oddly.. all my other port forwardings work just fine.. I know they do otherwise some of my apps wouldn't be working properly. Please help.. is it the fact apache says 'server offline' that's screwing me? how do I change that ? if that's not it.. then any idea what it might be? I know how to port forward normally... this is just weird.. I don't understand why it won't work thanks guys.. i appreciate it
×
×
  • 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.