Jump to content

hey_suburbia

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Everything posted by hey_suburbia

  1. Sorry about the post above that was regarding a missing ";", this is the error I'm getting: Warning: shuffle() expects parameter 1 to be array, object given in /nfs/c04/h03/mnt/65395/domains/nhsonline.org/html/templates/nhs/glider.php on line 9
  2. Thanks, but when I did this: <?php shuffle($videos) foreach ($videos as $video): $video_count++; if ($video->header=="") $play="true"; else $play="false"; ?> I got this: Parse error: syntax error, unexpected T_FOREACH in /nfs/c04/h03/mnt/65395/domains/nhsonline.org/html/templates/nhs/glider.php on line 10
  3. Here is a snippet of code I have to populate images and use glider.js to power the image viewer, but I need to make each image random... Any thoughts? Code: <?php foreach ($videos as $video): $video_count++; if ($video->header=="") $play="true"; else $play="false"; ?> <div class="video-list-item"> <a href="javascript:switchHeader('<?=$video->text1?>','<?=$video->file?>','<?=$video->header?>','<?=$video->link?>',<?=$play?>,true)"> <img style='float:left;' src="<?=$this->baseurl?>/images/videos/<?=$video->thumbnail?>"> </a> <div class='wrapper'> <h3><a href="javascript:switchHeader('<?=$video->text1?>','<?=$video->file?>','<?=$video->header?>','<?=$video->link?>',<?=$play?>,true)"><?=$video->text1?></a></h3> <p class='black' ><?=$video->text2?></p> <p style='font-weight: normal' class='black' ><?=$video->text3?></p> </div> <a href="javascript:switchHeader('<?=$video->text1?>','<?=$video->file?>','<?=$video->header?>','<?=$video->link?>',<?=$play?>,true)">> VIEW</a> </div> <?php if ($video_count%3==0 && count($videos)!=$video_count) print "</li><li>"; ?> <?php endforeach; ?></li> Site for reference (The images in the yellow bar): http://www.nhsonline.org/
  4. Thanks rajivgonsalves, that was stupid of me... Thanks everyone for helping out! Case closed.
  5. GOT IT TO WORK! <?php $sendTo = $_POST["email"]; $subject = "Check out this Holiday Card I made"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: " . $_POST["name"] ." <" . $_POST["email"] .">\r\n"; $headers .= "Reply-To: " . $_POST["email"] . "\r\n"; $headers .= "Return-path: " . $_POST["email"]; $flashVar = $_POST["copycode"]; $message = "<a href=\"{$flashVar}\">View Your Card /a>"; mail($sendTo, $subject, $message, $headers); ?> The only problem now is that the email body shows "View Your Card /a>"
  6. This works: <?php $sendTo = $_POST["email"]; $subject = "Check out this Holiday Card I made"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: " . $_POST["name"] ." <" . $_POST["email"] .">\r\n"; $headers .= "Reply-To: " . $_POST["email"] . "\r\n"; $headers .= "Return-path: " . $_POST["email"]; $message = $_POST["copycode"]; mail($sendTo, $subject, $message, $headers); ?> This doesn't work: <?php $sendTo = $_POST["email"]; $subject = "Check out this Holiday Card I made"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: " . $_POST["name"] ." <" . $_POST["email"] .">\r\n"; $headers .= "Reply-To: " . $_POST["email"] . "\r\n"; $headers .= "Return-path: " . $_POST["email"]; $flashVar = $_POST["copycode"]; $message = "<a href=\"{$flashVar}\">View Your Card/a>" mail($sendTo, $subject, $message, $headers); ?> For some reason this doesn't work either: <?php $sendTo = $_POST["email"]; $subject = "Check out this Holiday Card I made"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: " . $_POST["name"] ." <" . $_POST["email"] .">\r\n"; $headers .= "Reply-To: " . $_POST["email"] . "\r\n"; $headers .= "Return-path: " . $_POST["email"]; $message = "<a href=\"{$message}\">View Your Card/a>" mail($sendTo, $subject, $message, $headers); ?> :'(
  7. Here is what I came up with, but now I'm not receiving anything...?? I think it has something to do with the "$message2" variable that I setup to receive the flash variable "copycode" <?php $sendTo = $_POST["email"]; $subject = "Check out this Holiday Card I made"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: " . $_POST["name"] ." <" . $_POST["email"] .">\r\n"; $headers .= "Reply-To: " . $_POST["email"] . "\r\n"; $headers .= "Return-path: " . $_POST["email"]; $message2 = $_POST["copycode"]; $message = "<a href=\"{$message2}\">Your greeting card</a>" mail($sendTo, $subject, $message2, $headers); ?>
  8. Thank You, I shall give it a try and report back!
  9. Hello All. I'm having a bit of a hard time getting something (which I believe is rather simple) to work. Here goes: I have a Flash Holiday card sending a long query URL variable to PHP called "$message". I tested just a simple send mail and everything works perfect: <?php $sendTo = $_POST["email"]; $subject = "Check out this Holiday Card I made"; $headers = "From: " . $_POST["name"] ." <" . $_POST["email"] .">\r\n"; $headers .= "Reply-To: " . $_POST["email"] . "\r\n"; $headers .= "Return-path: " . $_POST["email"]; $message = $_POST["copycode"]; mail($sendTo, $subject, $message, $headers); ?> Currently, the email body receives a VERY long URL. I want to have the long URL hidden from view by just putting it into an HREF. Something like this: <a href="{$message}">Your greeting card</a> I'm pretty sure I'll have to send an html email, which is OK. But I can't get the syntax to work. Can anyone offer advice/samples? THANKS!
  10. I didn't manually install it, I assumed Media Temple had it already. Is this something I can install myself or would I need to call my server and have them do it? http://hallmedia.com/phpinfo.php
  11. I added the following to my .htaccess: AddType application/x-httpd-php .html Now I'm getting prompt to download my html files every time I click on a link rather than going to the link, any advice? Thanks!
  12. Here is the portion in question: <p class="style2" align="center">-----------------------------------------------------------------------</p> <p class="style2" align="center">YOUR PERSONALIZED CARE PLAN -- WAYS TO HELP YOUR CHILD</p> <p class="style1" align="left">Remember, parents should continue to watch for stress reactions for at least the first 6 weeks after their child is injured. To make sure that a child has the best recovery, parents should call their child’s doctor or school counselor IF: </p><ul> <li>A child’s stress reactions go on for more than one month after the injury; or</li> <li>A child’s stress reactions get worse, bother him, or worry his parent(s); or</li> <li> A child’s stress reactions get in the way of his physical recovery. </li> </ul> <p class="style1" align="center">Here are the tips you chose based on your ratings of your child's reactions and your concerns.<br> We encourage <strong>you</strong> to come back to the website as needed to explore other care tips</p> <br><br><br><br><br><br><br> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <br><br><br><br><br><br><br><br><br><br> <br><br> <table align="center" border="0" cellpadding="5" cellspacing="5"> <tbody><tr><th colspan="2"><div align="center">How to help with Re-experiencing: Reliving what happened</div></th></tr> <tr><th ,="" colspan="2" bgcolor="#d3d3d3">TIPS</th></tr><tr><td ,="" colspan="2" bgcolor="#e6e6e6"><ul><li>Notice when your child is feeling worried or lost in their thoughts - and ask what's on their mind.</li></ul></td></tr><tr><td ,="" colspan="2" bgcolor="#e6e6e6"><ul><li>Listen when your child wants to talk.</li></ul></td></tr><tr><td ,="" colspan="2" bgcolor="#e6e6e6"><ul><li>If your child has questions about his/ her injury, treatment, or any other parts of what happened, try to answer simply and honestly.</li></ul></td></tr><tr><td ,="" colspan="2" bgcolor="#e6e6e6"><ul><li>Help your child deal with overwhelming or troubling thoughts by learning how to 'take a break' from them at times - do something fun, spend time with friends, get busy with other activities.</li></ul></td></tr><tr><td ,="" colspan="2" bgcolor="#e6e6e6"><ul><li>Notice your own feelings. Are there times when you don't want to talk with your child about what happened - because it's upsetting to you? If so, be sure to reach out to family and friends to get support for yourself.</li></ul></td></tr>
  13. When this runs and I view the source code I get about 30 random <BR> tags that leave a giant gap in the middle of the code. I get the <br> tags before this line: <p align="center" class="style2">-----------------------------------------------------------------------</p> <p align="center" class="style2">YOUR PERSONALIZED CARE PLAN -- WAYS TO HELP YOUR CHILD</p> Full code: <table border="0" align="center" cellpadding="5px" cellspacing="5px"> <!-- ---------------------- RE_EXPERIENCING ---------------------- --> <tr><th colspan="2"><div align="center">Re-experiencing: Reliving what happened</div></th></tr> <?php $counter = 1; $bgcolor = ""; include("reactionInfo.php"); $reactionInfoObject = new reactionInfo($_SESSION["step1b_POST"]); if($counter >= 1){ foreach($reactionInfoObject->reexperienceBArray as $reexperienceObj){ $counter++; if (($counter % 2) == 0){ $bgcolor="#e6e6e6"; }else{ $bgcolor="#d3d3d3"; } echo("<tr> <td bgcolor='" . $bgcolor . "' width='370px'> <div align='left' class='tablePad'>" . $reexperienceObj[0] . "</div> </td> <td bgcolor='" . $bgcolor . "' width='220px'> <div align='left' class='tablePad'>" . $reexperienceObj[1] . "</div> </td> </tr>"); } } ?> <!-- ---------------------- AVOIDANCE ---------------------- --> <tr><th colspan="2"><div align="center">Avoidance: Staying away from reminders</div></th></tr> <?php $counter = 1; $bgcolor = ""; if($counter >= 1){ foreach($reactionInfoObject->avoidanceBArray as $avoidanceObj){ $counter++; if(($counter % 2) == 0){ $bgcolor="#e6e6e6"; }else{ $bgcolor="#d3d3d3"; } echo("<tr> <td bgcolor='" . $bgcolor . "' width='370px'> <div align='left' class='tablePad'>" . $avoidanceObj[0] . "</div> </td> <td bgcolor='" . $bgcolor . "' width='220px'> <div align='left' class='tablePad'>" . $avoidanceObj[1] . "</div> </td> </tr>"); } } ?> <!-- ---------------------- Hyper-arousal ---------------------- --> <tr><th colspan="2"><div align="center" class='noSymptomsPad'>Hyper-arousal: Feeling anxious or jumpy</div></th></tr> <?php $counter = 1; $bgcolor = ""; if($counter >= 1){ foreach($reactionInfoObject->hyperBArray as $hyperObj){ $counter++; if(($counter % 2) == 0){ $bgcolor="#e6e6e6"; }else{ $bgcolor="#d3d3d3"; } echo("<tr> <td bgcolor='" . $bgcolor . "' width='370px'><div align='left'>" . $hyperObj[0] . "</div></td> <td bgcolor='" . $bgcolor . "' width='220px'><div align='left'>" . $hyperObj[1] . "</div></td> </tr>"); } } ?> <!-- ---------------------- Other Concerns ---------------------- --> <tr><th colspan="2"><div align="center">Other concerns</div></th></tr> <?php $counter = 1; $bgcolor = ""; if($counter >= 1){ foreach($reactionInfoObject->concernsBArray as $concernsObj){ $counter++; if(($counter % 2) == 0){ $bgcolor="#e6e6e6"; }else{ $bgcolor="#d3d3d3"; } echo("<tr> <td bgcolor='" . $bgcolor . "' width='370px'> <div align='left' class='tablePad'>" . $concernsObj[0] . "</div> </td> <td bgcolor='" . $bgcolor . "' width='220px'> <div align='left' class='tablePad'>" . $concernsObj[1] . "</div> </td> </tr>"); } } ?> <!-- ---------------------- Family Concerns ---------------------- --> <tr><th colspan="2"><div align="center">Concerns about how others in the family are coping</div></th></tr> <?php $counter = 1; $bgcolor = ""; if($counter >= 1){ foreach($reactionInfoObject->copingBArray as $copingObj){ $counter++; if(($counter % 2) == 0){ $bgcolor="#e6e6e6"; }else{ $bgcolor="#d3d3d3"; } echo("<tr> <td bgcolor='" . $bgcolor . "' width='370px'> <div align='left' class='tablePad'>" . $copingObj[0] . "</div> </td> <td bgcolor='" . $bgcolor . "' width='220px'> <div align='left' class='tablePad'>" . $copingObj[1] . " </div> </td> </tr>"); } } ?> </table> <p></p> <?php if($reactionInfoObject->twoCount > 0){ echo('You marked ' . $reactionInfoObject->twoCount . ' item(s) as "Always / Very much". Most children have a few stress reactions to a sudden or frightening event like an injury, especially during the first few weeks. Based on your ratings, your child his having at least some stress reactions that might be really bothering him. There is a lot that you can do to help your child, but you may need some extra help'); }; ?> <p align="center" class="style2">-----------------------------------------------------------------------</p> <p align="center" class="style2">YOUR PERSONALIZED CARE PLAN -- WAYS TO HELP YOUR CHILD</p> <p align="left" class="style1">Remember, parents should continue to watch for stress reactions for at least the first 6 weeks after their child is injured. To make sure that a child has the best recovery, parents should call their child’s doctor or school counselor IF: <ul> <li>A child’s stress reactions go on for more than one month after the injury; or</li> <li>A child’s stress reactions get worse, bother him, or worry his parent(s); or</li> <li> A child’s stress reactions get in the way of his physical recovery. </li> </ul> </p> <p align="center" class="style1">Here are the tips you chose based on your ratings of your child's reactions and your concerns.<br /> We encourage <strong>you</strong> to come back to the website as needed to explore other care tips</p> <table border="0" align="center" cellpadding="5px" cellspacing="5px"> <tr><th colspan="2"><div align="center">How to help with Re-experiencing: Reliving what happened</div></th></tr> <?php echo("<tr><th bgcolor='#d3d3d3', colspan='2'>TIPS</th></tr>"); foreach($_SESSION["tipsArray"][0] as $tip){ echo("<tr><td bgcolor='#e6e6e6', colspan='2'><ul><li>" . $tip . "</li></ul></td></tr>"); echo("<br />"); } ?> <tr><th colspan="2"><div align="center">How to help with Avoidance: Staying away from reminders</div></th></tr> <?php echo("<tr><th bgcolor='#d3d3d3', colspan='2'>TIPS</th></tr>"); foreach($_SESSION["tipsArray"][1] as $tip){ echo("<tr><td bgcolor='#e6e6e6', colspan='2'><ul><li>" . $tip . "</li></ul></td></tr>"); echo("<br />"); } ?> <tr><th colspan="2"><div align="center">How to help with Hyper-arousal: Feeling anxious or jumpy</div></th></tr> <?php echo("<tr><th bgcolor='#d3d3d3', colspan='2'>TIPS</th></tr>"); foreach($_SESSION["tipsArray"][2] as $tip){ echo("<tr><td bgcolor='#e6e6e6', colspan='2'><ul><li>" . $tip . "</li></ul></td></tr>"); echo("<br />"); } ?> <tr><th colspan="2"><div align="center">How to help with other concerns</div></th></tr> <?php echo("<tr><th bgcolor='#d3d3d3', colspan='2'>TIPS</th></tr>"); foreach($_SESSION["tipsArray"][3] as $tip){ echo("<tr><td bgcolor='#e6e6e6', colspan='2'><ul><li>" . $tip . "</li></ul></td></tr>"); echo("<br />"); } ?> <tr><th colspan="2"><div align="center">How to help with concerns about how others in the family are coping</div></th></tr> <?php echo("<tr><th bgcolor='#d3d3d3', colspan='2'>TIPS</th></tr>"); foreach($_SESSION["tipsArray"][4] as $tip){ echo("<tr><td bgcolor='#e6e6e6', colspan='2'><ul><li>" . $tip . "</li></ul></td></tr>"); echo("<br />"); } ?> </table>
  14. I'm trying to get my php generated page into a PDF. I've tried fPDF, but found it too tedious to create all of the dynamic tables/images I'll use. I then tried to use free online tools that create html to PDF on the fly. My problem is that the online tools give me back just my static html not my php generated content. I even get php errors... When I view the source of my php in question, I see the normal html format (no php). I even tried to use file_get_contents and all I get is generic html with my url in a frameset??... I need to somehow grab the html that creates all the tables/info and extract that, can anybody lean me in the right direction. Thanks
  15. I have been using an open source upload/management script and I wanted to add a progress bar to the upload section (with KB/s too). I've tried a bunch of ways, but I'm unable to integrate it into my existing script. Could anyone offer some assistance, whether it be php/ajax/js My upload script uses three files: upload.php upload.tpl form.tpl I've included them in a .zip file here: http://www.basicfunction.com/upload.zip I will be forever grateful, THANKS!!!
  16. Thanks, that worked. I just changed it around a little and I think you had a typo, on the [code]mysql_fetch_array($select)[/code], it should be [code]mysql_fetch_array($query)[/code] No biggie, thanks! [code]$select = "SELECT name FROM memberlist WHERE email = '$email';"; $query = mysql_query($select); while($row = mysql_fetch_array($query)) { // THen you access your table columns through the array.  Using there names as values like $row['name']; $name = $row['name']; // that would print out the email address from the database. }[/code]
  17. I have a simple form that checks to see if you're email is in the DB and if so, it redirects you. I wanted to know how to associate that email with the name field in the DB. Something like: [code]$fetch_exist=mysql_query("SELECT name FROM memberlist WHERE email = '$email'"); $name = $fetch_exist;[/code] ???? Would that work?
  18. thanks. So if I put the session_start() before this: [code]$fetch_exist=mysql_query("SELECT email FROM memberlist WHERE email = '$email'"); //then check if the email is there if(mysql_num_rows($fetch_exist)>0) {     //it's in the database, bring them to logged in area header('Location: http://site.com/directory/page.php'); exit; } else { //it's not in the database, bring them to sign-up header('Location: http://site.com/page2.html'); exit; }[/code] It should work, right?
  19. I have a very basic login that determines if the email address exists in the DB and if it does they get redirected, if not they get redirected elsewhere: [code]$fetch_exist=mysql_query("SELECT email FROM memberlist WHERE email = '$email'"); //then check if the email is there if(mysql_num_rows($fetch_exist)>0) {     //it's in the database, bring them to logged in area header('Location: http://site.com/directory/page.php'); exit; } else { //it's not in the database, bring them to sign-up header('Location: http://site.com/page2.html'); exit; }[/code] This works great. The problem occurs when I try to start the session, which is this: [code]session_start(); $_SESSION ['email'] = $email;[/code] I tried putting it before the if/else statement, I tried putting it into the if statement.  All return blank fields in the database. On my sign up page, I have the same thing (without the redirect and it works great). So, I guess my question becomes, where do I start the session on a page that redirects.  I tried to start it on the page that you get redirected to, but I would have to pass the $email variable to that page... Any thoughts? THANKS!!!
  20. Thanks! I got it working by just putting the date into a variable: [code]$thedate=date('l dS \of F Y h:i:s A'); $result = mysql_query("INSERT INTO counter (email,name,pagename,date)". "VALUES ('$sess', '$sess2', '$scr2', '$thedate')");[/code]
  21. @Cesear I am passing these variables: [code]$sess=$_SESSION['email'] ; $sess2=$_SESSION['visitor'] ; $scr=$_SERVER['SCRIPT_FILENAME'];[/code] I have it working now, up to the date, so I'm thinking the date syntax is wrong?
  22. This give me a nice read out: [code]      echo ("INSERT INTO counter (email,name,pagename,date)".       "VALUES ('$sess', '$sess2', '$scr2', ".date('l dS \of F Y h:i:s A').")");[/code] but this won't go into my DB: [code]      $result = mysql_query("INSERT INTO counter (email,name,pagename,date)".       "VALUES ('$sess', '$sess2', '$scr2', ".date('l dS \of F Y h:i:s A').")");[/code] Any thoughts?  It's connecting because if I try just this: [code]      $result = mysql_query("INSERT INTO counter (email)".       "VALUES ('$sess')");[/code] It gives me a new field but they are blank...
  23. I got it to work! Now for some reason I'm having trouble writing it to my DB table??? The echo text came out perfect, why is this not writing to my DB: [code] session_start(); $sess=$_SESSION['email'] ; $sess2=$_SESSION['visitor'] ; $scr=$_SERVER['SCRIPT_FILENAME'];       $result=MYSQL_QUERY( "INSERT INTO counter (email,name,pagename,date)".       "VALUES ('$sess', '$sess2', '$scr2', ".date('l dS \of F Y h:i:s A').")"); [/code]
  24. First off, Thanks ronverdonk for being patient with me, you're being VERY helpful! Second, I think I'm missing some fundamentals here (please bare with me)...   On my login page I have: [code]session_start(); $_SESSION ['email2'] = $email2; //write visitor record to counter table   $result=MYSQL_QUERY("INSERT INTO counter (email)".       "VALUES ('$email2')"); [/code] I checked my table and it successfully writes my email to the email field. Now if I sign in with a different email it will write the SAME email into the counter table.  I assume this is because of the session_start(); and no logout.... That's part I. Part II I'm still unclear on what exactly I should have on my other pages that will record where they are. Do I connect to the database again on each page?  IE (mysql_connect...etc.) and do I use session_start(); on these pages? Thanks so much!
  25. The page renders, but on top I get: [quote]INSERT INTO counter (email,pagename,date) VALUES (, /com/mysite/public_html/page1.php, time() [/quote]
×
×
  • 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.