Jump to content

gabrielkolbe

Members
  • Posts

    41
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

gabrielkolbe's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi I have scanned the forum but can't seem to find the answer to this, I have tried various solutions without success. Maybe someone can help. I want to rewrite www.website.com/index.php?wishlist=username To www.website.com/wishlist/username or www.website.com/username I don't want it to end in username.html or username.php Help will be greatfully received!
  2. Hi I have scanned the forum but can't seem to find the answer to this, I have tried various solutions without success. Maybe someone can help. I want to rewrite www.website.com/index.php?wishlist=username To www.website.com/wishlist/username or www.website.com/username I don't want it to end in username.html or username.php Help will be greatfully received!
  3. yes, I agree. But how do you check if the php dependencies are available (like smtp, gd, curl) with function_exist() ?
  4. Simple change your layout to; <?php include('inc/headinc.php'); ?> <?php include('inc/sql.php'); ?> (run all your queries here then the rest of the page, title ect will be dynamic) <title>Home</title> <?php include('inc/leftinc.php'); ?> <?php include('inc/rightinc.php'); ?> <div class="maincontent"> </div> <?php include('inc/endinc.php'); ?>
  5. Hi, thanks for that. I can use function_exist, but also need to verify the data in the phpinfo() page.. i don't understand 'pass the phpinfo() data to grep or something.' please explain. I probably need to get phpinfo() into a string..??
  6. I have a dynamically generated list, I want a user to be able to select more than one value, for each one of these values I want to add a seperate entry in to the db, I can seem to get an array with the $_POST[] value of the form, can any one give me some advice here? here is the dynamic generated form.. <select name="sub1" size="<?=$check?>" multiple> <option>ALL</option> <? $query = " SELECT resourcesubtype.Type, resourcesubtype.ID FROM rates WHERE AND resourcetype = ".$_POST['resourcetype'].""; $result = mysql_query($query); $check = mysql_num_rows($result); while ($row = mysql_fetch_assoc($result)) { echo '<option'; if ($row['ID'] ==$_POST['sub1']) {echo ' selected'; } echo ' value = '.$row['ID'].'>'; echo $row['ID'].' '.$row['Type']; echo '</option>'; } ?> </select>
  7. Hi, I have a website, which I want to install on 'clients' servers..the website run on PHP, MySQL. Firstly I want a page to check if PHP is installed, then MySQL, then smtp, gd, curl. Can I use the phpinfo(), ? I tried to use phpinfo() place it in a string and search the strings for certain values, but it does not seem to work.. does anyone have any ideas, or better any scripts I can just edit? I would be greatful.
  8. Hi, i am not too familiar with oop, and have would really like to use this class where I get the geo location from a user via the ip address. I get this error because the script is written for php5 and I need to convert it to PHP4. I changed ' Private' for ' Var' which helps , what do I change ' Public' to ? Here's the class..... <?Php /** * This class generates the country name and its flag from its IP address * * * @author Rochak Chauhan */ class CountryFromIP { private $CountryIPDatabase = 'CountryIPDatabase.txt'; private $ip = ''; /** * Function to validate IP ( please modify it according to your needs) * * @param $ip - string * * @return boolean */ public function ValdateIP($ip) { $ipArray = explode(',',$ip); if(count($ipArray) != 4) { echo "<font color='red' size='3'> <b>ERROR: </b> Invalid IP</font>"; return false; } else { return true; } } /** * Function to return Country name from the IPDatabase * * @param $ip string * * @return string - name of the country, false otherwise */ public function GetCountryName($ip) { $this->ip = $ip; $ip = sprintf("%u", ip2long($ip)); $csvArray = file($this->CountryIPDatabase); for($i=0; $i<count($csvArray); $i++) { $arrayOfLine = explode(',', $csvArray[$i]); if($ip >= $arrayOfLine[0] && $ip <= $arrayOfLine[1] ) { return $countryName = $arrayOfLine[2]; } } return false; } /** * Function to return local path to Country's flag * * @param $ip - string * * @return string - local path to flag image */ public function ReturnFlagPath() { if($countryName = trim(ucwords(strtolower($this->GetCountryName($this->ip))) )) { $countryName = str_replace(' ','%20',$countryName); return "flag/$countryName.gif"; } else { return false; } } } ?>
  9. Thanks for pointing that out, but only get the course_name that come through not the id...
  10. Hi, thanks but it does not seem to work, I get the following error.. Query was empty
  11. Hi I have a query...where I loop through courses, I get the id for each course, pass it to the next page then, I want to query the database again with it, how do I do this. Will be appreciated if someone can help me. Thanks <select name="course"> <?PHP $query = "SELECT * FROM courses ORDER BY course_name"; $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) { echo "<option id='".$row['id']."' >"; echo $row['course_name']; echo ' ['.$row['course_date'].'] ' ; echo ' &pound'; echo $row['course_price']; // echo the number echo '</option>'; } ?> </select> Get the ID then pass it.. how do I use it again on another page and another query? $query = "SELECT * FROM courses WHERE id = ???? "? $res = mysql_query($que) or die(mysql_error()); while ($row = mysql_fetch_object($res)) {
  12. Hi, I have a property website, on it I have a drop down box where all cities are displayed. I want to count how many properties there are for each city and then display the number next to the city, so that users can know how many properties are available for each city. Here is my code so far, I would appreciate someone to help me here!! Don't be confused by the code I have tried various ways of making this work. NOTE: I think it would probably be easier to push the cities in an array, use the unique array function to only display 1 of each city, BUT before this, count the amount of times each city appears.... <select name="city" class="formfields"> <option value="All" selected>All Cities</option> <? //$i = 0; $cities = array(); $query = "SELECT * FROM prop order by city"; $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) { array_push($cities, $row['city']); //for ($i = 1; $i <= 10; $i++) { // echo $i; //} //if (array_key_exists($row['city'], $cities)) { //$i=$i+1; echo '<option>' . $row['city'] .' [' . $i . ']</option>'; } } ?> </select>
×
×
  • 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.