Jump to content

teynon

Members
  • Posts

    898
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by teynon

  1. You need to do some benchmarking and figure out where exactly it's taking all that time.
  2. If I cut and paste exactly what Barand posts, it works fine for me. PHP.net says all those classes are available in 5.3. Are you getting an error? Do you know how to turn errors on?
  3. What version of PHP are you using?
  4. $Profit2012 = ob_start(); include 'Page1.php'; ob_end_clean(); $Profit; What is all this jumble? Just use $Profit2012 include 'Page1.php';
  5. Random thought, if you'd like, I can take a look and at the same time show you how to debug some of this in Chrome. (Chrome Remote Desktop: https://chrome.google.com/webstore/detail/chrome-remote-desktop/gbchcmhmhahfdphkhkmpfmihenigjmpp?utm_source=gmail)
  6. The request is fine because you saw it send the request in the developer / network tab? (In other words, is the network tab reporting the request as successful?) If so, click on the request in Chrome and see what the output is.
  7. Use what Barand posted, way more functional than mine.
  8. Decided to have a little fun with this one. <?php if (!interface_exists("Object_Array")) { // Blend the interfaces. interface Object_Array extends Iterator, Countable { } } class dateRange implements Object_Array { private $stopDate, $startDate, $pointer, $mode; public $output; public function __construct($start, $stop, $mode = "month", $output = "F Y") { $this->startDate = strtotime($start); $this->stopDate = strtotime($stop); $this->pointer = $this->startDate; $this->mode = $mode; $this->output = $output; } public function current() { return date($this->output, $this->pointer); } public function key() { return $this->pointer; } public function next() { switch ($this->mode) { default: // Get next month $this->pointer = mktime(0,0,0, date("m", $this->pointer) + 1, 1, date("Y", $this->pointer)); break; } } public function rewind() { $this->pointer = $this->startDate; } public function valid() { if ($this->pointer <= $this->stopDate) { return true; } return false; } public function count() { $total = 0; switch ($this->mode) { default: $start = $this->startDate; while ($start < $this->stopDate) { $start = mktime(0, 0, 0, date("m", $start) + 1, 1, date("Y", $start)); ++$total; } break; } return $total; } } $date = new dateRange("1/31/2010", "5/31/2012"); foreach ($date as $monthYear) { echo $monthYear . "<br />"; } echo count($date);
  9. You start with the year and month as the start date. No day involved. Or default to 1 for day.
  10. $_POST is a super global. So it will be accessible to all included files automatically. Are you "including" the file like "include('myfile.php');" or including it as like an iframe or something like that?
  11. If you are trying to make a sort of "quick" login, you can make a sort of "reader" page that submits the data. For example: <body onload="$('#form').submit();"> <form id="form"> <input type="hidden" name="username" value="<?php echo $_GET['user'];?>"> <input type="hidden" name="password" value="<?php echo $_GET['password'];?>"> </form> However, you would have to send the users password in the query string which would be highly insecure. Not sure if you're trying to bypass a login page of something you don't know or not. You could do the same thing with an ajax request to log in the user.
  12. The point of what I posted was to demonstrate that you can send variables in the query string while still submitting POST form data. What / why the user is trying to do is not entirely clear.
  13. Here is how you might do it 1) Start date. Get year and month. EX: 2012 / 01 2) End Date. Get year and month. EX: 2013 / 02 Psuedo code date = start date while (date <= endDate) { monthsCovered[] = date('month'); date = date + 1 month }
  14. To answer the POST and GET question, yes. <form action="mypage.php?myvar=123&myvar2=1234" method="POST"> </form> You could just include additional hidden form values though.
  15. I'd say she want's to send one email to multiple people as per her original question. The PHP mail function link tells you exactly how to do it. As for the "error". We still don't know what error message she is referring to since she hasn't posted it.
  16. teynon

    similar rows

    This kind of sounds like homework.
  17. Have you tried anything else with the code I sent you? Just because I provided you with code doesn't mean that code will plug and play. I wrote it to get you started. http://jsfiddle.net/CZxbM/ $(document).ready(function(){ var cname = $("#imabox"); cname.on("blur", function() { validateName($(this)); }); cname.on("keyup", function() { validateName($(this)); }); }); You need to look into learning how to debug javascript with Firefox or Chrome.
  18. teynon

    Text Stretch

    http://jsfiddle.net/LUyNF/ I probably wouldn't do this though. Transforms cause lots of problems. For example, Transformers trying to bring their planet here, consume our world, and make us pets.
  19. Coding is not a big secret... PHP.net has pretty much everything you need to know about PHP. I'd say PHP has one of the best manuals / documentation out there. (I'm tempted to say it is the best.) As Jessica stated, you can search PHP.net for the mail function. Jessica, I really like this site you used a while ago. http://lmgtfy.com/?q=PHP+mail+function&l=1 Also, as kind of a survey for me, where have you "seen folks use $emailAddresses" or learned that coding is a big secret? Not being rude, I just want to learn what your process is. This could help me understand how to help you guys/girls better.
  20. There was an issue with his session variable as well. He was assigning $usersession instead of $username. I don't want to just give people simple answers anymore. For example in this post: http://forums.phpfreaks.com/topic/275257-php-echo-numbering/ where the poster obviously hasn't tried anything. The point is, these type of questions are failing at simple debugging. Just giving them the answer will solve their current problem, but only teaches them to come back here next time they debug. "Give a man a fish feed him for a day. Teach a man to fish, feed him for life."
  21. If you use the .on like I was suggesting, you'll need to change the function as well. var form = $("#myform"); var cname = $("#company_name"); var cnameInfo = $("#cnameInfo"); cname.on("blur", function() { validateName(this); }); cname.on("keyup", function() { validateName(this); }); function validateName(cname){ if(cname.val().length < 4){ cname.addClass("error"); cnameInfo.text("We want names with more than 3 letters!"); cnameInfo.addClass("error"); return false; } else{ cname.removeClass("error"); cnameInfo.text(""); cnameInfo.removeClass("error"); return true; } }
  22. Ok, so what functions exist in that code? date(), and mktime(), correct? So now that you know what functions you can use, you can search for them in the PHP manual. http://www.php.net/manual/en/function.date.php If you see something in the code that you don't understand, you should always look it up.
  23. Call me OCD, but why do you switch between Object Oriented and Procedural mysqli calls?
  24. What have you tried?
  25. Look real hard at this: INSERT INTO videotable (title,,description,video) VALUES ('$vidtitle','$viddescrip','$vidvideo')
×
×
  • 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.