Jump to content

darkhappy

Members
  • Posts

    46
  • Joined

  • Last visited

    Never

Everything posted by darkhappy

  1. what happens if you just ping 192.168.1.45 from your machine?
  2. what about for php 6? i am a noob and i just bought larry ullman's book on learning php 6. is anyone going to be hosting this anytime soon?
  3. the syntax you used was in the link i provided in my original response, that you claim has nothing to do with this. read first, then second-guess - get it?
  4. obviously - this is why i linked the php.net article for that piece, thanks for filling it in.
  5. I am not really understanding your question. Why can't you just add "checked" to the input tag for boxes you want checked? You may need to change your if statement so that the boxes you want to show as checked are not getting created by the line after the else, which does not include "checked" in the input tag.
  6. create a counter for the loop, then put an if statement inside the loop to check if the counter is even or odd. if its even apply class 1, if its odd apply class 2. there are several ways to check if an integer is even or odd, i am not sure the best way but there are some examples here: http://www.php.net/is_numeric. <?php $counter = 0 foreach ($array as $value) { $counter = counter + 1; if (counter is even) { class = 1; } else { class = 2; } //rest of foreach loop }?>
  7. i use godaddy with the linux package and i get all the normal functions. it is just slow sometimes.
  8. sorry if this is the wrong category to post this in i was not sure - i currently host my php site with godaddy, it's still in development but as i bring it online and hopefully get customers and more databases i am sure i will need to move it somewhere else. can some of you share your thoughts on pros and cons of different hosting services? godaddy is pretty slow (at times) and i can't install a database admin tool from my desktop (i have to login to the web to use myPHPadmin) - which is also kind of slow. thanks for any info. - dhappy
  9. I have tried both ways and empty fields are still evaluating to true. What am I doing wrong? Here is my code: <?php foreach($checkarr1 as $v4) { if(ctype_alnum($v4)) { echo "'".$v4."'-"; } } ?> $checkarr1 is an array created from a row in a CSV file, some values are null and I only want to echo $v4 for valid fields. I put '' around the var so I can see the blanks when it outputs. thanks, dhappy
  10. How can I check $var for characters 0 - 9 and a -z (and what ohter normal charactes should I look for?)? I am processing a value from a CSV file if I run the check if ($var!='') on some of the fields it returns TRUE even though the CSV field is empty, so I need to check the $var to make sure it contains data. Please let me know if this question does not make sense so I can re-phrase or give more info. Thank you, dhappy
  11. i will have to try that next time... instead i tweaked this function to pull the key out of the variable once it is posted. lots of work for a 1 little number hehe! <?php function get_sheet() { $context = '_POST'; global $$context; if(isset($$context)) { foreach($$context as $k => $v) { $sheetid = $k; } } } get_sheet(); ?>
  12. I am getting an error when processing this code - could anyone give me the proper syntax/puntuation for this? <?php while ($a = mysql_fetch_array($approvals)) { if(isset($_POST['{$a['approvals']}'])) { $sheetid = $_POST['{$a['approvals']}']; } } ?>
  13. hmm ok i will try that thanks...
  14. I see where you're going with that, I'd like to approve 1 at a time. It's actually easier because its 1 click and just reloads the page. I think I figured out how though. I can use the "name" parameter as suggested in the first reply, and set the value to "approve". then when i process the script i can run the same query i used to display the approval options to begin with, and use a while loop to cycle through different POST statements until I find a match. i think that would work - assuming i can insert a $var into existing $_POST['var'].........
  15. if i made the name unique how would i know how to recall this information once i post it ($_POST['??'])?
  16. I have a while loop that pulls rows of data from a sql table, and at the beginning if each row I have a button that says "Approve Sheet ID # xxxxx". I want the button to just say "Approve" and attach the unique sheet id some other way in the button without it displaying - do you know if there is a way to do this? Or some other way to get the unique identifier to post without putting it in the value of the "Approve" button? <input name="approve" type="submit" class="style4" value="Approve Sheet ID #<?php echo $sheetid?>" />
  17. I am trying to write a foreach loop that will set all the dates in an array back 1 week if flag 'lastweek' is set. The date-modify function seems to make the most sense but i get fatal errors when using it. When I try to convert to a timestamp with date and mktime i get 1970 for the year. for that code i did: date("Y",$value) and it comes out to 1970 every time even though $value (from the foreach loop below) is something like 04-24-2008. any ideas? I have been hacking away at this for hours and am clueless. <?php $week = array($monday, $tuesday, $wednesday, $thursday, $friday, $saturday, $sunday); if($_SESSION['lastweek'] == "1") { foreach($week as $d => $value) { $date = new DateTime($week[$d]); $date->modify("-1 week"); } unset($_SESSION['lastweek']); } ?>
  18. OOOOOOOOOHhhhhhhhhhhh...... so instead of creating a certain # of fields across 1 table ahead of time, you just create new tables as needed and link the associated fields with an ID - is that right?
  19. here is a post i saved w/ java and php solution http://www.phpfreaks.com/forums/index.php?topic=189985.0
  20. cool thanks - how would i know what size to create the sql table that i want to put the selected values into since i don't know how many the user is going to select?
  21. could someone show me what the code would look like to put the data from this array into var's once it's posted? thanks, bb
  22. could someone show me what the code would look like to put the data from this array into var's once it's posted? thanks, bb
  23. php session names from from here: <?php session_start(session_name); i think you would have to dig into your cart script to see where that ID is coming from - could be an encrypted session name or cookie? you could store any variable into a SQL database with MD5 encryption and it would look like that.
×
×
  • 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.