Jump to content


Staff Alumni
  • Posts

  • Joined

  • Last visited

  • Days Won


jcbones last won the day on June 27 2015

jcbones had the most liked content!

About jcbones

  • Birthday 05/16/1975

Profile Information

  • Gender
  • Location
    North Carolina

jcbones's Achievements


Newbie (1/5)



  1. So, $start1, $start2, $start3 has nothing to do with posting the form, it is only database call? Yet, you are using that to determine the state of the button? So, you should either. 1. Check the form submission to set the button. OR, 2. Move the include for safe.php BELOW your updates, so that you pull the info AFTER you update it. (currently you update the info after you pull it).
  2. Where do you create the variables. $start, $start2, $start3?
  3. Questions should be clear and concise, leaving 0 margin for doubt. The reason you are getting no response is: No One Knows What You Are Talking About! 1. Brief statement of what you are desiring to do. 2. Any code that is relative to the problem. 3. How the output is different than what is desired. Follow those steps, and you will get replies.
  4. You include connect.php in your poll.php file with a relative file path. This will work if you are accessing poll.php itself, but will not work if poll.php is included in another file, as that file will do the include. So, PHP is looking in the pages/ folder for the file connect.php. You should put an absolute file path to the connect file. require_once ('absolute/path/to/connect.php'); This is the exact reason that so many of us stress that you must use absolute file paths to every included file.
  5. So you want to allow 1 space, but no more? The above code given will remove ALL spaces. 1 space but no more is: preg_replace('~\s\s+~','',$username);
  6. If he hasn't opened a connection, then his query wouldn't work. So the fix is to open a connection.
  7. That is correct. What do you mean by "not working"?
  8. Sorry, it is hard to part sarcasm into a post.
  9. delimiter being talked about is the semi-colon after your variable. And, you are echo'ing it, but judging from your post, you are wanting to know how to remember it's checked state. 1. A checkbox is either on or off. 2. You shouldn't use short tags, as it is being removed, and is not very portable. 3. You need to use the POST array to set the checked value. 4. You need to know which checkbox you are inquiring about, so use indexes. Example <input name="status[1]" id="pending" value="Shouldn't be a POST variable" <?php if(isset($_POST['status'][1])) echo 'checked'; ?> />
  10. Did you echo the type out, and see what it was? I know that IE sents png's as x-png and jpeg's as pjpeg. If I were you, I would echo out the file types (in all browsers) to make sure I covered them all.
  11. Replace mysql_clean() with mysql_real_escape_string().
  12. Yep, both split() and explode() did the same thing, so they dropped split(), same for join() and implode().
  13. The header() function cannot be used after output has been sent to browser. This includes any HTML outside of PHP, and whitespace outside of PHP, or any echo, print, print_r, etc. (any function or construct that outputs to the page, including errors, notices, etc.).
  14. Your query is failing, this should tell you why. <?php error_reporting(-1); ini_set('display_errors',1); $link = mysql_connect('localhost', 'root', ''); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully<br />'; $arr = array(); $rs = "SELECT `id`, `title`, `author`, `date`, `imageUrl`, `text` FROM `items`"; $rs_return = mysql_query($rs) or trigger_error($rs . ' has encountered an error: <br />' . mysql_error()); while($obj = mysql_fetch_array($rs_return)) { $arr[0] = $obj['id']; $arr[1] = $obj['title']; $arr[2] = $obj['author']; $arr[3] = $obj['date']; $arr[4] = $obj['imageUrl']; $arr[5] = $obj['text']; } //numbering the array indexes, will only return 5 array indexes EVER. All indexes will be over written on each loop. echo '{"items":'.json_encode($arr).'}'; ?>
  • 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.