Jump to content

unsider

Members
  • Posts

    610
  • Joined

  • Last visited

    Never

Everything posted by unsider

  1. It's most likely an error before the cookie values. As awpti said, check whitespace, and any included files, etc.. (i'm assuming that is only an excerpt from the full script). session_start(), etc.. Has to be before anything is output.
  2. I suppose so, but not with a 'language' like PHP, that would require a 'lower-level' language. I'm not qualified to answer that question, but I'm sure it involves a good bit of knowledge. If you can't read the contents of the .doc file I'd suggest looking for alternatives to reading it, or just trying to recreate it on a .txt file (if possible). Either way, .doc is not an acceptable format.
  3. Quick little script, to generalize the idea. <?php // do some kind of test to see if user is logged in if($session->logged_in){ // test if the $_POST values have been set on the form if(isset($_POST['textarea'])) { // set your variables $text = $_POST['text']; $username = $_SESSION['username']; // if not set, make sure they know if(!isset($_POST['textarea'])) { echo "Fill in the form please."; } // SQL query to insert the data $sql="INSERT INTO 'table' VALUES (' ', '$text', '$username')"; // if cant connect, present error, or die(); if (!@mysql_query($sql)) { echo 'Error adding query: ' . mysql_error(); } } } ?> Look that over, and see if it helps your situation.
  4. Sounds like you want to take a look at $_SESSION values. Go read up a quick tutorial or two and see if that's the solution to your problem.
  5. .doc is not an acceptable format, it would be best to use .txt or .rtf for PHP
  6. So in another attempt to start some discussions in this section. I'm curious what musical instruments the members of this board play. I've been playing piano off/on for about 6 years, and I'm currently working on Chopin's Etude Op. 12-10 I've also picked up guitar, and have been playing for a few months, I'm pretty bad. And I play trumpet for my school band, about 4 years. You guys..?
  7. That is one thing I respect about this community, I haven't seen any maligning, it's a learning enviroment sure, but even then you still expect some form of critisism, and that's pretty cool.
  8. Time is based on server, like eRott said, slow server, slow mail. If you can't contact who controls your server, you may want to invest in your own if this is an important issue. Just what i'd do.
  9. Glad he helped you understand, saved me from writing up a little demo . Glad you learned something from it though.
  10. index.php <?php include("affiliates.php"); affiliates(); ?> affiliates.php <?php function affiliates() { echo "I love all my affiliates."; } ?> Clean up that code, and you forgot the include. Function is voided without. Curse you Film
  11. Discovered an error somewhere else in my backend script. Probably should have looked a little harder.
  12. Alright, I've written a poll that allows you to vote once, retreiving your IP and logging it into a .dat file. Well upon loading of the 'index' I am iterating an IF statement to determine whether to display the poll choices, or the poll results based on the IP you are viewing the page with. All of my functions are operational, 'has_voted', and 'the_current_poll_results' Problem: I would like to display my the_current_poll_results(); function. Although it continues to display my (show_vote_control('1' ); function. As well as $ipaddress, so everything is outputting. I fear the problem may be in my syntax somewhere, but I can't for the life of me find it. Everything seems like it should work, although I'm still having problems. If you need any more code, questions, etc.. let me know. index.php <?php require_once('backendfunctions.php'); $ipaddress = $_SERVER['REMOTE_ADDR']; global $PREVENT_DUPLICATE_VOTES; if($PREVENT_DUPLICATE_VOTES && has_voted($poll_id, $ipaddress)) { the_current_poll_results(); } else { echo "$ipaddress"; show_vote_control('1'); show_vote_control('2'); } ?> List of functions: backendfunctions.php <?php $PREVENT_DUPLICATE_VOTES = TRUE; function vote_history_add($poll_id, $ipaddress, $vote_value_id) { $history_fp = @fopen(vote_history_file_path($poll_id), "a"); if($history_fp === FALSE) { die("Unable to open history file for writing"); } @flock($history_fp, LOCK_EX); fputs($history_fp, $ipaddress . "|" . $vote_value_id . "\n"); fclose($history_fp); } function explode_history($line) { return array_map("trim", explode("|", $line)); } function vote_history_list($poll_id) { // Load existing vote history $summarylist = @file(vote_history_file_path($poll_id)); if($summarylist !== FALSE) { $summarylist = array_map("explode_history", $summarylist); } return $summarylist; } function has_voted($poll_id, $ipaddress) { $vote_history_list = vote_history_list($poll_id); if($vote_history_list !== FALSE) { return( find_vote_history(trim($ipaddress), $vote_history_list) !== FALSE ); } else { return FALSE; } } function find_vote_history($ipaddress, $list) { if(!empty($list)) { for($i = 0; $i < count($list); $i++) { if($list[$i][0] == $ipaddress) return $list[$i]; } } return FALSE; } ?>
  13. Looks like javascript, although it's probably AJAX. Just to give you an idea, I'm not 100% sure though. It certainly isn't 'just' PHP though.
  14. I'm not completely sure if this would be a valid solution, but I think if I understand you.. You want to change textbox properties? Best option is to use CSS. <textarea name="yourcomments" cols="30" rows="5" class="content_box" maxlength="" value=""> .content_box { background-color: #000000; border: 1px solid #292929; color: #FFFFFF; width: 145px; } It also may be your browser, or an issue out of your control.
  15. I thought everyone knew that... then again, most of the "answers" are crap. I didn't discover it until recently, and it's been said earlier, but that seems to be my biggest issue. It doesn't fit my situation, and it requires more research. Which is better for me in the long run anyway, but I agree, probably not worth paying the fee.
  16. Unfortunately I used to play all of the time, but I recently switched to the Mac platform, and they do not have an install patch for the later OSs, and I no longer have a computer running Windows, so I can't play. So I've been playing WCIII:TFT. Which is another reason I'm so excited, I haven't played in months. But if I at any time manage to get a machine running windows I'm PM my username. Haha, and I did a youtube search for SC tournaments. It'sconsidered a sport in Korea, and they take it as seriously there as Americans do college football, etc...
  17. May I ask what this class is called, ex. computer apps, entry level web devlopment, and what level of education, high school? Just curious, because my school offers a list of 'computer' classes, and I've always been curious if they are worth the time, although I'm probably ahead of what they might be teaching. And excuse my derailing of this thread.
  18. I didn't understand that, either 1. the way it is worded 2. i'm not insane, and that's impossible Can you re-eleborate?
  19. He wants you to read , then come back with a question. Frustrating, but it's for your own good.
  20. I'd say that's a solid 9.2/10. It looks professional, everything flows smoothly. You've got you're a nice little buisness site right there. Good job.
  21. No one else here plays starcraft, I figured I would get a few more responses considering how extensive it's roots are.
  22. You're right, it doesn't. And you were right, error fixed. Thanks.
  23. I'll try that, and.. 4.0.23
  24. Suprisingly this is the first time I'm working with <select> tags, and the data just so happens to be 'gender'. With the option of selecting 2 values. "Male", "Female". Well I need to take this information and write it to my database. There is already a connection to my database, and everything is functional, I'm just not sure how I'm not sure of the syntax. DB = mtlc?old table = 'users' feild = 'gender' This is all strictly input, I will be outputting the data elsewhere. <table> <tr> <td>Gender:</td> <td><select class="select" name="gender" id="gender" value=" <?php if($form->value("gender") == ""){ echo $session->userinfo['gender']; }else{ echo $form->value("gender"); } ?>"> <option value="-1">Gender:</option> <option value="1">Female</option> <option value="2">Male</option> </select> </td></tr> <tr> <td>Gender:</td> <td><input type="text" name="gender" value=" </td> <td><?php echo $form->error("gender"); ?></td> </tr> </table> Thanks, if anyone can help.
  25. CREATE TABLE `gallery_images` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(64) character SET utf8 NOT NULL, `ext` varchar( character SET utf8 NOT NULL, `image_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `data` longblob NOT NULL, PRIMARY KEY (`id`) ); I'm getting SQL error: #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `data` longbl
×
×
  • 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.