-
Posts
3,584 -
Joined
-
Last visited
-
Days Won
3
Everything posted by JonnoTheDev
-
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; ?>
-
$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 />"; }
-
Easily. Get a decent spec server though. You should consult the SMF community for more info. http://docs.simplemachines.org/index.php?topic=9
-
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.
-
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.
-
Sorry. Ive got to say that this is the worst HTML I have ever seen.
-
Read the sticky at the top of this forum on using headers. You cannot use a header post printing output to the screen.
-
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!!!!!
-
$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
-
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.
-
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'
-
Use a parser i.e. simpleXML $xml = simplexml_load_string($data); http://uk3.php.net/manual/en/intro.simplexml.php
-
blog_posts ======== blog_id user_id blog_content blog_posts.user_id = user.id
-
Correct. Paypal has code examples. https://www.paypal.com/ipn
-
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.
-
-
Please provide the data that the loop needs to loop through. A foreach loop may not be the best choice.
-
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.
-
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(); ?>
-
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>
-
<?php $source = "<<##red##>><<##green##>><<##blue##>>"; preg_match_all('/<<##([a-z]+)##>>/', $source, $result, PREG_PATTERN_ORDER); foreach($result[1] as $colour) { print $colour."<br />"; } ?>
-
Are your curl params in a function? If so is the array within the function scope?
-
Automatic logout after 60 Minutes of inactivity
JonnoTheDev replied to danielspencer2's topic in PHP Coding Help
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. -
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie[$he][loc]); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie[$he][loc]);