Jump to content

camdagr81

Members
  • Posts

    43
  • Joined

  • Last visited

    Never

About camdagr81

  • Birthday 04/22/1978

Contact Methods

  • Website URL
    http://www.illumifi.net
  • Yahoo
    camdagr8

Profile Information

  • Gender
    Male
  • Location
    Columbus, Oh - United States

camdagr81's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. $path = pathinfo($_SERVER['PHP_SELF']); echo $path['basename'];
  2. <?php // get_file_name() Function function get_file_name($string) { $str_array = explode("/", $string); $token = count($str_array) - 1; $file = explode("?", $str_array[$token]); return $file[0]; } // Usage: echo get_file_name($_SERVER['PHP_SELF']); ?>
  3. Well if you're folders are on a network and your webserver has access to those folders, you can write a page using the copy() function then you can run the page from where ever you are (provided you have an internet connection) and update the files remotely.
  4. This is correct. The only way to automate file uploads is to set up an ftp server on your webserver and either run a batch file that will automate the process, find an ftp client that will allow you to schedule uploads, or write a php script using the ftp commands.
  5. You could of course use $_SERVER['HTTP_REFERER'] and try to come up with a statement that would determine if the user was coming from a page that is ahead of the current page in the site map. <?php $ref = $_SERVER['HTTP_REFERER']; if (preg_match('/page2.php/i', $ref)) { header("Location: page1.php"); } ?>
  6. <?php $query = "SELECT `mobile` FROM `customer`"; $result = mysql_query($query) or die(mysql_error()); $to = array(); while(list($mobile) = mysql_fetch_row($result)) { $to[] = $mobile; } // Test it foreach($to as $mobile) { echo $mobile . "<br>"; } ?>
  7. I tried to simplify what you're trying to do and maybe this will work. Try leaving the sprintF and the variable typing alone and see if that works: //Set the username as a variable $uname = $_SESSION['MM_Username']; $favsong = "Whatever your $_POST is for the favsong"; if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = "INSERT INTO `information` (`usernm`, `favsong`) VALUES ('$uname', '$favsong')"; mysql_select_db($database_registration, $registration); $Result1 = mysql_query($insertSQL) or die(mysql_error()); }
  8. My best guess is to start with a point of origin. Say New York City and then each zipcode from there out to Los Angelos has a distance from the orgin point associated to it. Then create a calculation that will give you the relation of a specific place based on the city you're trying to find out where some other city is farthest from. For example: if we make New York City our origin point and set it's value at 0 and want to know how far from Columbus, OH is from Atlanta, GA you would do the following equation (Pythagorean Theorem) a = NYC to COL ^ 2 (squared) b = ATL to COL ^ 2 c = NYC to ATL ^ 2 solving for b in the equation... a + b = c b = c - a then take the square root of b * Note this only works when you plot the 3 points as a right triangle
  9. Sure is $query = "SELECT temp_name,temp_char,temp_varchar FROM templates WHERE temp_name IN ('banner','link_txt')"; $sql = mysql_query($query,$conn) or die(mysql_error()); while(list($temp_name, $temp_char, $temp_varchar) = mysql_fetch_row($sql)) { echo $temp_name . '<br />'; echo $temp_char . '<br />'; echo $temp_varchar . '<br />'; }
  10. The problem is that you're not quoting your field and variable names. //Set the username as a variable $uname = $_SESSION['MM_Username']; ("INSERT INTO `information` (`usernm`) VALUES ('$uname')")
  11. <?php header("Location: www.yoursitehere.com/yourpage.php"); ?>
  12. That should do. Maybe add an index.php that sends the header to your main page: //Body of index.php in that directory <?php header("Location: http://www.yoursite.com"); ?> This will prevent anyone trying to get the directory structure of your folder. You should add that in all folders that don't have an index.html/php etc in them.
  13. cookies auto array, all you have to do is specify the name of the item when adding it to the cookie. [code] $time = time() + 360000; setcookie("sbh[id]", "$id", "$time", "/", ".sbhmed.com"); setcookie("sbh[uname]", "$uname", "$time", "/", ".sbhmed.com"); setcookie("sbh[fname]", "$fname", "$time", "/", ".sbhmed.com"); setcookie("sbh[ulevel]", "$ulevel", "$time", "/", ".sbhmed.com"); setcookie("sbh[email]", "$email", "$time", "/", ".sbhmed.com"); setcookie("sbh[date]", "$date", "$time", "/", ".sbhmed.com"); [/code] To retrieve the item you would do something like this: [code]echo $_COOKIE['sbh']['fname'];[/code]
  14. The problem is that you have $i set as 1 where it should be 0 but here's a better way to do it $query2 = "SELECT * FROM `phpnews_news` ORDER BY `id` DESC LIMIT 6"; $result2 = mysql_query($query2); $num = mysql_num_rows($result2); mysql_close(); for($i = 0; $i < $num; $i++) { // Your loop stuff here }
×
×
  • 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.