Jump to content

Buddski

Members
  • Posts

    1,236
  • Joined

  • Last visited

About Buddski

  • Birthday 09/16/1985

Contact Methods

  • Website URL
    http://www.buddski.com

Profile Information

  • Gender
    Male
  • Location
    Victoria, Australia

Buddski's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. echo " <form action=\"config.php\" method=\"post\"><br /> <input name=\"checkbox\" value=\"Enable music requests\" type=\"submit\" /><br /><br /> <input name=\"checkbox2\" value=\"Disable music requests\" type=\"submit\" /> </form> <form name=\"input\" action=\"process2.php\" method=\"post\"> DJ Message:<br /> <input type=\"text\" size=\"50\" maxlength=\"200\" value=\"".file_get_contents("djmessage.txt")."\" name=\"checkbox3\" /> <input type=\"submit\" value=\"Update\" />";
  2. I have no idea what you are trying to do there.. Can you show the WHOLE snippet of code, not just that half line.. It looks like you are opening php tags inside, what I presume to be, an echo statement. If you are wanting to use that text file as the value of a HTML element use file_get_contents(), but without seeing the rest of the code I cant help with implementing it.
  3. This line $exifdata = array('Caption', 'Copy', 'Camera', 'Shutter', 'fNo', 'ISO', 'Date', 'Time'); is creating the numerical keys with those values assigned. With the rest of your code in place you can just replace that line with $exifdata = array();
  4. Well, to start with your counting for the replies would never have really worked, you dont need to store them in the database at all!! Here is a little query you can use on your main_forum.php SELECT `forum_question`.*, COUNT(`forum_answer`.`a_id`) as `replies` FROM `forum_question` Left Join `forum_answer` ON `forum_answer`.`question_id` = `forum_question`.`id` GROUP BY `forum_question`.`id` ORDER BY `forum_question`.`id`
  5. Inserting data will happen instantaneously (kind of).. Did you make the a_id auto-incrementing?
  6. Your array has 8 numeric keys and 8 associative keys. You are getting that output because your array contains all of those 16 elements (as the var_dump states) Will your array always contain these 16 elements?
  7. My guess is this part is failing and returing 1 // Find highest answer number. $sql="SELECT MAX(a_id) AS Maxa_id FROM $tbl_name WHERE question_id='$id'"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); // add + 1 to highest answer number and keep it in variable name "$Max_id". if there no answer yet set it = 1 if ($rows) { $Max_id = $rows['Maxa_id']+1; } else { $Max_id = 1; } As a suggestion, you could remove this code altogether if you set a_id to auto-incrementing, then you will never have to pass a value to a_id. Why do all the work when MySQL can do it for you.
  8. From the looks of the one line of code you posted, you are sending a plain text email. To do what WebStyles is suggesting you will need to send html emails.
  9. Instead of just writing ERROR write something a little more useful. echo "ERROR" , mysql_error(); I have also notices that you are setting $tbl_name to 'forum_answer' Then run this query $sql2="INSERT INTO $tbl_name(question_id, a_id, a_name, a_answer, a_datetime)VALUES('$id', '$Max_id', '$a_name', '$a_answer', '$datetime')"; But according to you database structure forum_answer does not contain any of those columns..
  10. This will throw an undefined variable error. The OP's original code was correct, I suspect the issue is in the retrieval. $key = "apple"; $arr = array($key => "fruit"); print_r($arr); // Output: Array ( [apple] => fruit )
  11. You could also split your responseText using a \n I guess. For example, your AJAX would return something like <img src="1.jpg"> <img src="2.jpg"> and then using javascript to split it.. var parts = xmlhttp.responseText.split("\n"); part[0] would contain <img src="1.jpg"> and part[1] would contain <img src="2.jpg"> Or..something (its 1:30 and I have to bee up in 6hrs for work so im a little scattered) The only other way would be to return a javascript object which you would more than likely have to eval() to make it usable.
  12. This is my most hated thing.. dates. 25/10/2011 can either be read as "The 25th day of the 10th Month" (Aussie dates) or "The 10th day of the 25th Month" PHP has decided to choose the latter, which isnt a real date thus returning a 0 for strtotime.
  13. Can you show us what is actually contained in $largedate
×
×
  • 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.