premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
Are you sure your tests for the unseen is a good test? Cause if it is seen than that just displays nothing.
-
basename I think that would do the trick.
-
Yes you can.
-
[SOLVED] inequality comparing two identical time strings?
premiso replied to bluesoul's topic in PHP Coding Help
The reason being is you used two if statements. The first one ran, than the second also ran, which of course the dates were equal so that if statement went to the else, thus overwriting the $sort[$k]. You set your self up to fail by doing that =), the elseif makes it all part of the same if so $sort[$k] does not get overwritten. -
[SOLVED] inequality comparing two identical time strings?
premiso replied to bluesoul's topic in PHP Coding Help
You're if statements are wrong. Try this: if ($exp_date[$k] == $whois_exp_date[$k]) { $sort[$k] = "match"; } elseif ($exp_date[$k] != $whois_exp_date[$k]) { $sort[$k] = "nomatch"; } else { $sort[$k] = "error"; } It should work. (note [ php] kills formatting when copy/pasting.) -
You only need 2 tables. That is the reason you have the diagnoses table so you can have multiple entries for one user. The date field is no unique and nor should it be. The only part about the diagnose table that should be unique is the diagnoseid. This will prevent errors from coming up with multiple dates for 1 user or the same dates entered twice for one user. That is how it should function, 2 tables are all you need. Stop confusing yourself with thinking about a third table.
-
Wow I cannot believe I forgot the code tags, now I feel retarded.
-
Post the form code...
-
Yeah, I remember you telling me to use characters not on keyboard for salt. I'm doing that. Also, I am setting a minimium length. Ok, so if I set a maxlength of 35, I'll be fine? I can't help worrying about everything.....I worry too much.....I get stressed out and start worrying about everything. imo, a password over 20 characters is too long. Chances are the user will not remember it etc. But any length of password will generate a unique hash and the chances of collision will be very slim either way. That is why MD5 is also used in CheckSUM to verify that you are downloading the correct file.
-
I think you would want to use use file_get_contents to get the file then use fopen and write the contents from file_get using fwrite then close the file with fclose I am not sure if this will work, but yea, especially depending on the file size the script would time out.
-
How to Make Spaces and Slashes delimit like commas in ELGG
premiso replied to biodrux's topic in PHP Coding Help
Post on the Forums for ELGG? If it is open source chances are they have forums where people do tweaks etc. This should be under the "Third Party section" since this is directly related to ELGG, and you have not posted the section where you would like it to be changed. -
Are you even uploading the new version of the script? It seems like you are not uploading any corrected version and it is staying as the old version, hence why none of the solutions worked. Try this version, since you got the array message now and you know the fields are populated: <?php $menu1 = "none"; $menu2 = "none"; $menu3 = "none"; ?> <?php include '../../inc/pageheadhome.inc'; ?> <body id="home" class="colSM"> <?php include '../../inc/header_home.inc'; ?> <? // This is correctly indented ?> <div id="colmain3"> <div class="col3"> <div><div> <dl> <table id="Table_01" background="FACES_register/facesVideo.jpg" width="772" height="585" border="0" cellpadding="0" cellspacing="0"> <tr valign="middle"> <td width="194" valign=""> </td> <td width="561"><table><tr><td colspan="3"><table width="543"> <tr><td width="528" height="188px"> </td> </tr> <tr><td> <?php function spamcheck($field) { //filter_var() sanitizes the e-mail //address using FILTER_SANITIZE_EMAIL $field=filter_var($field, FILTER_SANITIZE_EMAIL); //filter_var() validates the e-mail //address using FILTER_VALIDATE_EMAIL if(filter_var($field, FILTER_VALIDATE_EMAIL)) { return TRUE; } else { return FALSE; } } if (isset($_REQUEST['email'])) { //if "email" is filled out, proceed //check if the email address is invalid $mailcheck = spamcheck($_REQUEST['email']); if ($mailcheck==FALSE) { echo "Invalid input"; } else {//send email $Name = "name"; //senders name $email = "from.mycompany.com"; //senders e-mail adress $recipient = $_REQUEST['email']; //recipient $reply = "Congratulations! Video access for " .$_POST['fname']." ".$_POST['lname'].""; $mail_body = $reply . "body content"; //mail body //mail body $subject = "Video Access"; //subject $headers = "From: ". $Name . " <" . $email . ">\r\nbcc: blind@company.com\r\n"; //optional headerfields $headers .= "BCC: blindm@company.com\r\n"; mail($recipient, $subject, $mail_body, $headers); //mail command echo "<font size='3'><font color='#c61317'><strong>Thank you.</font></strong> Please check your email for the access link.</font>"; } } else {//if "email" is not filled out, display the form echo "<form method='post' action='videoAccess.php'> To gain access to the video archive, please fill out the form below.<br /><br /> First Name: <input name='fname' type='text' /><br /> Last Name: <input name='lname' type='text' /><br /> Email: <input name='email' type='text' /><br /><br /> Subject: <strong>Access to FACES archive</strong><br /><br /> <input type='submit' /> </form>"; } ?> And make sure that the correct version gets uploaded. That should work.
-
You need to do a mysql_num_rows equivalent in the PDO class. if (count($db->$query)>0) { That is not an array, and probably is a resource, unless the class is setup to return an array after a query.
-
floor to round down ceil to round up.
-
Yes, fill in the inputs and submit the form. When it hits the section I put in there it will die and print out an array to the screen.
-
while (list ($name,$val) = @each ($_POST['package_'])) { echo "$name $val"; $total += $val; } echo "Total: " . $total;
-
Wow...please use the [ code] and [ /code] tags (without the space after [). Too much scrolling makes my brain not think.
-
"PHP Help Forum" Not Linux Distro installation on PS3 Help Forum...
-
$theline, when split does not contain an array with 5 indexes.
-
Adding that code should return an Array( setup, not "business as usual" <?php $menu1 = "none"; $menu2 = "none"; $menu3 = "none"; ?> <?php include '../../inc/pageheadhome.inc'; ?> <body id="home" class="colSM"> <?php include '../../inc/header_home.inc'; ?> <? // This is correctly indented ?> <div id="colmain3"> <div class="col3"> <div><div> <dl> <table id="Table_01" background="FACES_register/facesVideo.jpg" width="772" height="585" border="0" cellpadding="0" cellspacing="0"> <tr valign="middle"> <td width="194" valign=""> </td> <td width="561"><table><tr><td colspan="3"><table width="543"> <tr><td width="528" height="188px"> </td> </tr> <tr><td> <?php function spamcheck($field) { //filter_var() sanitizes the e-mail //address using FILTER_SANITIZE_EMAIL $field=filter_var($field, FILTER_SANITIZE_EMAIL); //filter_var() validates the e-mail //address using FILTER_VALIDATE_EMAIL if(filter_var($field, FILTER_VALIDATE_EMAIL)) { return TRUE; } else { return FALSE; } } if (isset($_REQUEST['email'])) { print_r($_REQUEST); // note added this die(); // note added this. //if "email" is filled out, proceed //check if the email address is invalid $mailcheck = spamcheck($_REQUEST['email']); if ($mailcheck==FALSE) { echo "Invalid input"; } else {//send email $Name = "name"; //senders name $email = "from.mycompany.com"; //senders e-mail adress $recipient = $_REQUEST['email']; //recipient $reply = "Congratulations! Video access for " .$_POST['fname']." ".$_POST['lname'].""; $mail_body = "body content"; //mail body //mail body $subject = "Video Access"; //subject $headers = "From: ". $Name . " <" . $email . ">\r\nbcc: blind@company.com\r\n"; //optional headerfields $headers .= "BCC: blindm@company.com\r\n"; mail($recipient, $subject, $mail_body . $reply, $headers); //mail command echo "<font size='3'><font color='#c61317'><strong>Thank you.</font></strong> Please check your email for the access link.</font>"; } } else {//if "email" is not filled out, display the form echo "<form method='post' action='videoAccess.php'> To gain access to the video archive, please fill out the form below.<br /><br /> First Name: <input name='fname' type='text' /><br /> Last Name: <input name='lname' type='text' /><br /> Email: <input name='email' type='text' /><br /><br /> Subject: <strong>Access to FACES archive</strong><br /><br /> <input type='submit' /> </form>"; } ?> Use that code and see what it returns, it should not do any processing, but display a white page with an array element printed out to the screen.
-
<?php $strings[] = '$900.00'; $strings[] = '$900,001.00'; $strings[] = '$900 001.00'; foreach ($strings as $string) preg_match('#^([\$]?)([0-9,\s]*\.?[0-9]{0,2})$#', $string, $matches[]); print_r($matches); die(); ?> Is that what you are looking for?
-
I want to see what this code produces if (isset($_REQUEST['email'])) {//if "email" is filled out, proceed //check if the email address is invalid $mailcheck = spamcheck($_REQUEST['email']); print_r($_REQUEST); // note added this die(); // note added this. To make sure the $_REQUEST array has the values it needs to have. Run that and then paste the array that is returned.
-
if (isset($_REQUEST['email'])) {//if "email" is filled out, proceed //check if the email address is invalid $mailcheck = spamcheck($_REQUEST['email']); print_r($_REQUEST); die(); Replace that portion of the code with that and report back what is printed to the screen. EDIT: ALso noticed the mail function is wrong. mail($recipient, $subject, $mail_body, $reply, $headers); //mail command SHOULD BE mail($recipient, $subject, $mail_body . $reply, $headers); //mail command
-
$reply = "Congratulations! Video access for " .$_REQUEST['fname']." ".$_REQUEST['lname'].""; See if that works. If not your form is not populating/sending those values.
-
Pagination is what you are after. http://www.phpfreaks.com/tutorial/basic-pagination Great tutorial right there.