p2grace
-
Posts
1,024 -
Joined
-
Last visited
Never
Posts posted by p2grace
-
-
Glad I could help
Would you mind hitting the "Topic Solved" button when you have a chance?
Thank you!
-
The class should be required on the page requiring the current class. Then it would just be
$DB = new DB(); inside of the function.
public $db; public function __construct(){ $this->db = new DB(); }
-
Which part are you having trouble with? Basically what you would do is upon paying for the one-month subscription, the system would generate the password using an md5 hash of some sort, and then storing that in the database along with an expiration date. When that user tries to access the page check to see if the password exists, and if it does if the current date is less than or equal to the expiration date. If it is let them view the page.
-
Use this to check them:
if(isset($_GET['image_cat']) && isset($_GET['image_subcat'])){
You want to make sure both are set before using them. I didn't look at the rest of your code for any errors.
-
Try this:
<?php if(file_exists('wr/events.php')){ $file = array_reverse( file( 'wr/events.php' ) ); foreach ( $file as $line ){ echo "$line\n"; } }else{ echo "File doesn't exist"; } ?>
-
The link would have a get variable at the end of it, then just grab that get variable on the form and set it on the id value.
-
try this:
mysql_query("INSERT INTO `gallery_photos` (`photo_filename`, `photo_caption`, `photo_category` ) VALUES ('0', '" . $photo_captions[$counter] . "', '" . $_POST['category'] . "')");
The extra ) was after the first $counter variable
-
Try this:
<?php SELECT * FROM v2followups WHERE store='11' AND ((DATE_FORMAT(FROM_UNIXTIME(`day15`), '%Y/%m/%d') = '2008/05/16' AND day15status != 'c') OR (DATE_FORMAT(FROM_UNIXTIME(`day45`), '%Y/%m/%d') = '2008/05/16' AND day45status != 'c') OR (DATE_FORMAT(FROM_UNIXTIME(`day90`), '%Y/%m/%d') = '2008/05/16' AND day90status != 'c')) AND cbtype='f' ?>
-
What's the field type in the database? Is it date or timestamp?
<?php // if date $date = "$dateyear-$datemonth-$dateday"; // if timestamp $date = "$dateyear-$datemonth-$dateday ".date("H:m:s"); ?>
-
Awesome command:
<?php $clean = ctype_alnum($string); // returns true if only letters and numbers returns false otherwise. ?>
-
What do you mean they want to save the output? Do you want to save the variables entered into the form, or the actual html that is shown to the users after registering?
-
Need a bit more information. What do you mean you would like to select between the two? You'd receive two results back on the search query for the last name, so selecting between the two would just be selecting one of the two results returned. Can you give us more detail of how exactly you'd like to use the results?
Thanks
-
Use CURDATE() instead, the returning result will just be the date without the timestamp
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_curdate
-
-
Why not just md5 a timestamp?
-
The database is probably set to int, it needs to be set to varchar in the db
-
lol don't worry about it, we all have those moments.
Could you mark the topic as solved when you get a chance
Thanks
-
How are you viewing the page? Are you simple double-clicking the file and viewing it in IE or Firefox, because that won't work. You need to move the script to the xampp fileserver and then access it at http://localhost/test.php instead of simply viewing as c:\xampp\test.php.
I imagine that you're viewing it correctly and there's something else wrong, but this would be an obvious thing to check.
-
The session.cookie_lifetime and the session.cache_expire just like I showed you in my example. the only difference is that you're not making the change in the php code, but rather actually changing the ini settings in the php.ini file.
-
Sessions do expire, the lifetime is set in the php.ini file. Try adding this to your script right before you start the sessions, if it doesn't work you'll need to edit your php.ini file.
<?php ini_set('session.cookie_lifetime', 0); ini_set('session.cache_expire', 0); session_start(); header("Cache-control: private"); ?>
-
Try it in both queries
<?php function recruiters() { global $skin, $members, $db; $users = $members->fetch_rows(); $data = ''; foreach($users as $user) { $total_recruits = $db->result($db->query('SELECT COUNT(*) FROM `members` WHERE `recruiter` = "' . $user['id'] . '" ORDER BY `recruiter` DESC')); $active_recruits = $db->result($db->query('SELECT COUNT(*) FROM `members` WHERE `recruiter` = "' . $user['id'] . '" AND `status` <> (`status` | 64 ) ORDER BY `recruiter` DESC') ); $ratio = $active_recruits / $total_recruits; if($total_recruits > 0 and $ratio > 0) { $total_recruits = number_format($total_recruits, 0, '.', ',') . '%'; $active_recruits = number_format($active_recruits, 0, '.', ','); $ratio = number_format($ratio * 100, 2, '.', ','); $data .= '<tr><td class="normal">' . $members->link($user['id']) . '</td><td class="normal">' . $total_recruits . '</td><td class="normal">' . $active_recruits . '</td><td class="normal">' . $ratio . '</td></tr>'; } } return $skin->form_start('Top Recruiters') . '<table style="width:400px"><tr><td class="normal"><b>Member</b></td><td class="normal"><b>Total Recruits</b></td><td class="normal">Active Recruits</td><td class="normal">Percentage Active</td></tr>' . $data . '</table>' . $skin->form_end(); } } ?>
-
You'd need some sort of server-side language to do all of the processing and the sending of the email
-
No problem, I think it's ok to have it here since you are using php variables.
You'd use the CSS position: fixed; to keep it at the same page.
I wouldn't recommend using position: float
-
AKA: Moved (no need to recreate and delete)
The only way it would be related to php is if the content displayed was dynamic, which it sounds like it might be... in which case it would involve php.
[SOLVED] get rid of the annoying slashes
in PHP Coding Help
Posted
stripslashes()
http://us3.php.net/manual/en/function.stripslashes.php