Jump to content

cunoodle2

Members
  • Posts

    602
  • Joined

  • Last visited

    Never

Everything posted by cunoodle2

  1. I think we are going to need more information that what you have listed. I would suggest storing the values in a database and then using a php PDF generator to then create a PDF with these values.
  2. Yup. Looks good to me. I would just create a function to create a random string and then go from there. Here is an article on how to create that exact function.. http://snippets.dzone.com/posts/show/3123
  3. I think for something like this you will pretty much need to use flash. That or edit the songs with advertisements in the center of them. If the user buys the mp3 then they get the actual full song without advertisements.
  4. Sanitize your data. On this line.. $q = "SELECT * FROM `persons` WHERE `ID` = '".$_GET['id']."'"; You never have cleaned $_GET['id']. God only knows what could actually be in there. Additionally I would look into using PDO prepared statements as your code is not secure at all. And NEVER EVER use this.. php echo $_SERVER['PHP_SELF']; There are known massive vulnerabilities of this on the net. Go here.. and scroll down about 1/3rd of the page.. http://www.mc2design.com/blog/php_self-safe-alternatives
  5. How often would you say this list changes? Once per hour/day/week?
  6. Is there a reason to lean on foreach vs for? I've tried to use foreach many times and for some reason I just cannot wrap my head around it. Is it a performance/security issue?
  7. Echo $path; Does it look right?
  8. My bad..my post was wrong.I'm on a mobile device and hard to work with.
  9. I think php freaks needs a "like" button. Solid post! Also for all users reading this be sure to look at Pikachu2000 signature for the "Why $_SERVER['PHP_SELF'] is bad." I've been programming for years and had no idea..
  10. I use an "Insert" function that simply returns false OR the record that was inserted. There is quite a bit more to this but the function is essentially this.. <?php function Insert($query,$data) { $db_conn = new PDO(DB_CONN, DB_USER, DB_PASS); $db_conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); //prepare startment for inserting a record into the DB $insert_stmt = $db_conn->prepare($query); $insert_stmt->execute($data); $last_insert_id = $db_conn->lastInsertId(); //close up the DB connection to save on memory $db_conn = NULL; return $last_insert_id; } ?> Again that is only about 20% of the function. You should be using try/catch and error checking to make sure that everything works correctly.
  11. Then just do this.. echo "The Account Info page is: ".$account_info_page.php;
  12. What does "View > Source" show you in the html body of the page? Is anything there? I would change your variable names to be honest. The number "1" and the LOWER case letter "L" look exactly identicle and I'm wondering if you typed something wrong. Also it is hard to read your echo debugging code. Do this instead to make it easier to read.. Change all of the echo lines from this... echo "<b>1 on 1 (location A) value is:</b>".$content1_1on1; echo "<b>teams (location A) value is:</b>".$content1_teams; To this.. echo "<b>1 on 1 (location A) value is:</b>--".$content1_1on1."--<br />\n"; echo "<b>teams (location A) value is:</b>--".$content1_teams."--<br />\n"; That will make it much clearer to read.
  13. So you want items to show/hide and have everything on one page without reloading? This seems to be more so of a javascrip and/or ajax item.
  14. require_once "config.php"; ??
  15. Where exactly do you "want" this url from the account info page and how are you going to use it?
  16. File > Save As > "index.php" Done
  17. Do a "view html source" of your page after it runs to see if the html is there but not showing on screen for some reason. Also a php echo is always great for debugging.. Do this with your first IF statement.. <?php echo "<b>1 on 1 (location A) value is:</b>".$content1_1on1; echo "<b>teams (location A) value is:</b>".$content1_teams; if($content1_1on1 || $content1_teams) { echo "<b>1 on 1 (location B) value is:</b>".$content1_1on1; echo "<b>teams (location B) value is:</b>".$content1_teams; echo ''; echo "<script type='text/javascript'>$.jGrowl('<b>$header1</b> <br><br> $content1_1on1 <br> $content1_teams');</script>"; } Then do this with your SECOND If statement... <?php echo "<b>1 on 1 (location C) value is:</b>".$content1_1on1; echo "<b>teams (location C) value is:</b>".$content1_teams; if($content1_1on1 || $content1_teams) { echo "<b>1 on 1 (location D) value is:</b>".$content1_1on1; echo "<b>teams (location D) value is:</b>".$content1_teams; echo 's'; echo "<script type='text/javascript'>$.jGrowl('<b>$header1</b> <br><br> $content1_1on1 <br> $content1_teams');</script>"; } ?> Based upon that you should be able to trace through your code and see what the actual values are. I'm guessing that the variables change in your code and you are just overlooking something. Also as a side note I'm really not understanding why you have an "echo '';" in your first IF statement. What is it doing?
  18. I'm probably going to need to see a little coding example as I'm not 100% sure on what you are looking for. I can tell you that likely you want your form to "post" to one .php page but actually "go" to another?? If that is the case then try php curl to post something "in the background" or combine the pages together via an include statement.
  19. In the fuction try this.. INSIDE The function.. global $global_con_id; $global_con_id = $row['con_id']; OUTSIDE the function.. echo $global_con_id;
  20. Try google. Do a search for.. "using mysql_fetch_assoc to loop" The first result is from the manual.. http://php.net/manual/en/function.mysql-fetch-assoc.php Scrolling town a little but will show you "Example 1" In there is the following code.. <?php $sql = "SELECT id as userid, fullname, userstatus FROM sometable WHERE userstatus = 1"; $result = mysql_query($sql); if (!$result) { echo "Could not successfully run query ($sql) from DB: " . mysql_error(); exit; } if (mysql_num_rows($result) == 0) { echo "No rows found, nothing to print so am exiting"; exit; } // While a row of data exists, put that row in $row as an associative array // Note: If you're expecting just one row, no need to use a loop // Note: If you put extract($row); inside the following loop, you'll // then create $userid, $fullname, and $userstatus while ($row = mysql_fetch_assoc($result)) { echo $row["userid"]; echo $row["fullname"]; echo $row["userstatus"]; } mysql_free_result($result); ?>
  21. I'm tired of the drop menus when you want to search for like "between 300 and 900" Has anyone seen any cool interfaces to replace something like this? I know that this is a broad question but looking for something a little more interesting than just text boxes or drop down menus. Links to example sites are fine. I'm not looking for any coding help here.
  22. Do you have any suggestions in my above scenario on how you would prevent users from referring themselves? Any help would be greatly appreciated.
  23. Other than using IP address is there a way with php (or another web language) to tell the difference between 2 computers? Here is a little more info: I have a referral system in place on a site and I don't want a user to be able to refer themselves to get points. I don't want to limit this to IP address as very often co-workers refer each other and they almost always have the same IP at work. I don't want to use cookies as they can just delete them (cookies) and refer a new "fake account." Any ideas?
×
×
  • 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.