Jump to content

RussellReal

Members
  • Posts

    1,773
  • Joined

  • Last visited

Everything posted by RussellReal

  1. click the link that the function name is, it will take you to php.net and they explain all the parameters
  2. sure why not? just make sure you make the session expire in like 25 minutes lol
  3. <?php $number = '9998887777'; echo '('.substr($number,0,3).') '.substr($number,3,3).' - '.substr($number,6,4); ?>
  4. if you'd like to hire me to do it for you, that'd be good for me, however, if you want to do it yourself.. You could just put an htaccess file in your main directory like: mydomain.com/ and in there the .htaccess file THEN inside that you do RewriteEngine On RewriteCond %{REQUEST_URI} !-d RewriteCond %{REQUEST_URI} !-f RewriteRule ^(.*)$ user_index.php?query=$1 and then in the PHP to actually parse the string as it could be you use $_SERVER['QUERY_STRING'] and then you get after the 'query=' and then seperate by '=' and then parse them into your own GET array, I think $_POST should still be sent or carried over by the rewrite.. and then in user_index.php you handle all the data, and it WILL simulate the look and feel of your already existing system, except instead of hundreds of folders, you'll just have 1 file accessing 1 folder, or no folders, depending on how you code it
  5. as PFM says, all data is destroyed when the script exits, minus sessions, they are stored in a file somewhere on teh computer with the unique session ID for that session. Variables arn't exactly 'floating' around, they're exactly where you need them, there are two main reasons you'd unset a variable, 1) You have an if statement which checks for 'isset($whatever)' and you could have a certain procedure to check whether or not to actually unset $whatever or not due to other factors, but that is bad practice, you should use booleans for that. 2) You are handling alot of data, and to avoid your script producing an error and dying, you should free up memory as you progress in the script
  6. sorry for double post.. if you want to add me to MSN add me, I hafta sleep. sorry RussellonMSN@hotmail.com
  7. I'm not sure you're pulling the data correctly, I did a quick check and 'mysqli_query' doesn't exist
  8. <?php $miles = ($gallons = array()); while ($r = mysql_fetch_assoc()) { $miles[] = $r['mileagle']; $gallons[] = $r['gallons']; } $mileGauge = array_pop($miles) - $miles[0]; array_shift($gallons); $tg = 0; foreach ($gallons as $v) { $tg += $v; } $mpg = $mileGauge / $tg; ?>
  9. ok so from 100003 to 100050 you used 14.26 gallons of gas, is what thats saying?
  10. first question, is mileage only increasing? or could some be like 95 100 92 85 and does gallons represent the gallons left in the tank, or the gallons used?
  11. in UPDATE, the syntax is UPDATE `tableName` SET `fieldName` = 'value' WHERE `fieldX` = 'anotherValue' and to select in order of importance, higher importance would be @ top SELECT * FROM `tableName` WHERE `x` = 'x' ORDER BY `importance` DESC
  12. just use str replace foreach ($row as $k => $v) { str_replace('{'.$k.'}',$v,$data); } if you want to add those 'flags' in you might want to use substr and strpos to look for { and then get the rest to } remove the { } in the variable and then explode by | and then loop thru the parameters, or just pass it to a function which expects the parameters ion the order they were expecting them, either way its doable.
  13. when you submit that form, it WILL still be sent as & < etc... So when you receive the data, apply html_entity_decode() to it to make it plain text again without all the html specific entities
  14. -> is to go inward into an object <?php class Frog { public $name: public function Frog($name) { $this->name = $name; } public function talk() { echo $this->name.' Says: Ribbit<br />'; } } $rudie = new Frog('Rudie'); $rudie->talk(); ?> $rudie is an instance of the Frog class... -> tells it to go inside $rudie(Frog) and use the function talk() which would echo Rudie Says: Ribbit<br /> to reference a element inside an associative array you use the same brackets you use on a numbered array $arrayVar['nameOfElement'] and for numbered it would be: $arrayVar[10] for the 11th Element
  15. uhm, any SHARED data, should go into a shared database, and any website-specific data should go in its own database.
  16. they don't use SMTP for their inboxes, they use sql and count the results I'm not exactly sure how to work with emails with php, coz I havn't had any need to, however, this function looks promising imap_num_msg
  17. if you're on shared hosting, alot of the time they disallow remote connections.. if you make 12 sites, host them all on the same hosting package.. then it should work with no problem. If you are on a shared network and you absolutely MUST put each website on another hosting, than you might experience some problems. anything other than shared I think allows remote connections
  18. what're you tryna do..? it could be you didn't uncomment the gd package in your php ini.. it usually comes quoted out in php downloads
  19. that looks like it should work =\, are you CALLING the function?
  20. anytime bro, click 'solved' please
  21. no... you'd want a table like this: comment_id |comment_by_id |comment_to_video_id |comment |comment_rating_up |comment_rating_down
  22. when login.php 'okay's the credentials, you should set a session 'logged_in' or a cookie, and then in all the members' areas, check if ($_SESSION['logged_in']) { }
  23. haha, I'll do it for $25, send me an email if interested: RussellonMSN@hotmail.com
×
×
  • 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.