Jump to content

JonnoTheDev

Staff Alumni
  • Posts

    3,584
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by JonnoTheDev

  1. Do you have a php editor that uses colour coding? Makes the job a hell of a lot easier. <?php $message .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n Content-Transfer-Encoding: 7bit\r\n\r\n Hey ".$fname." ".$lname .", ".$yourname." has sent you a CheerCard.\r\nMessage: ". $message."\r\nRoom #: ".$room.$bound; ?>
  2. $result = mysql_query("SELECT group_number, SUM(the_value) AS total FROM myTable GROUP BY group_number ORDER BY group_number ASC"); while($row = mysql_fetch_assoc($result)) { print $row['group_number']." - ".$row['total']."<br />"; }
  3. Easily. Get a decent spec server though. You should consult the SMF community for more info. http://docs.simplemachines.org/index.php?topic=9
  4. Why would you create a url string that contains all of the input data? This would be easily open to abuse. If you want the data to remain persistent then either make the click to continue button a form submit, passing the user data into the form as hidden fields, or once the data has been validated then store it in session variables.
  5. You do not enclose variables in quotes ' as they will be intepreted as a string. print'$in->image' print $in->image; You have this issue littered all over your script.
  6. Sorry. Ive got to say that this is the worst HTML I have ever seen.
  7. Read the sticky at the top of this forum on using headers. You cannot use a header post printing output to the screen.
  8. http://hacksquadelite.webs.com This site has been made by a monkey. I wouldn't trust anyone who can't secure their own website to test mine. Utter garbage!!!!!
  9. You are assigning a value rather than comparing elseif(($numrows <= 0) && ($leader = 'yes')){ elseif(($numrows <= 0) && ($leader == 'yes')){ Also why would the number of rows be less that 0. You cant return a negative number of records elseif(!$numrows && $leader == 'yes'){
  10. $fetch = mysql_fetch_object($mysql); print $fetch->image; You may want to look at your variable naming. Your names don't make any sense to an onlooker. $mysql is very generic as it $fetch $queryResult = mysql_query("SELECT abc FROM table"); while($row = mysql_fetch_object($queryResult)) { print $row->abc."<br />"; } If you have more than 1 query then name the variable results accordingly ie. $userQueryResult, $messageQueryResult
  11. Ok you have to take the post as an example and modify the query to fit your design. You require a foreign key on the messages table to join it to a user. How do you currently know what messages belong to a user? Normalised design example users ==== userId image messages ======= messageId userId message Many messages can belong to one user. This is called a one to many relationship and is defined on the key userId.
  12. Simply select it from the database using the userId. The message contains the userId, correct? Use a left join on the query. Example SELECT m.*,a.filename FROM messages m LEFT JOIN avatars a ON (m.userId=a.userId) WHERE m.id='123'
  13. Use a parser i.e. simpleXML $xml = simplexml_load_string($data); http://uk3.php.net/manual/en/intro.simplexml.php
  14. blog_posts ======== blog_id user_id blog_content blog_posts.user_id = user.id
  15. Correct. Paypal has code examples. https://www.paypal.com/ipn
  16. Use paypal IPN. You should not have the user enter any information after a payment has been made. All user information should be recorded prior to the payment. The IPN will allow you to send information back to your website as a background post to say whether the payment was successful or not. You can record this data.
  17. Please provide the data that the loop needs to loop through. A foreach loop may not be the best choice.
  18. Because your HTML is bad. Enclose values in quotes. Also 01,02, etc is not an integer in php. <option value=01 <?php if ($nowday == 01) { echo"selected='selected'"; } ?>>01</option> Corrected <option value="01" <?php if ($nowday == "01") { echo "selected"; } ?>>01</option> Please use a loop. Writing it out like that looks awful.
  19. Set it as a member property <?php class foo { private $cookiePath; public function __construct($path) { $this->cookiePath = $path; } public function bar() { curl_setopt($ch, CURLOPT_COOKIEJAR, $this->cookiePath); curl_setopt($ch, CURLOPT_COOKIEFILE, $this->cookiePath); } } $x = new foo($cookie[$he][loc]); $x->bar(); ?>
  20. You can easily cut out all that unnecessary duplicate code with a loop. <select name="arriveday"> <?php for($x = 1; $x <= 31; $x++) { $dayNum = str_pad($x, 2, "0", STR_PAD_LEFT); print "<option value='".$dayNum."'".((date("d") == $dayNum) ? " selected" : false).">".$dayNum."</option>\n"; } ?> </select>
  21. <?php $source = "<<##red##>><<##green##>><<##blue##>>"; preg_match_all('/<<##([a-z]+)##>>/', $source, $result, PREG_PATTERN_ORDER); foreach($result[1] as $colour) { print $colour."<br />"; } ?>
  22. Are your curl params in a function? If so is the array within the function scope?
  23. It doesn't however the key fact is that the session is lost when the browser is closed. Imagine a piece of string with one person holding one end and another holding the opposite end. That is effectively the session between the browser an server. When the browser is closed imagine a big pair of scissors cutting the string in the middle. The only way to restore the connection is with a new piece of string i.e. a brand new session.
  24. curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie[$he][loc]); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie[$he][loc]);
×
×
  • 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.