Jump to content

MarkT

Members
  • Posts

    168
  • Joined

  • Last visited

Everything posted by MarkT

  1. MarkT

    PHP problems

    Problem fixed, Basically, I was trying to send a HTML email with a link, but the SQL query uses ', and the PHP uses " which meant it wasn't logging it properly, but still sent the emails, I ended up sending 10 emails without realising it, then I figured out the problem.
  2. MarkT

    PHP problems

    yes but it simultaneously executes an SQL query, which wasn't inserted properly, although it's inserted 10 already.
  3. MarkT

    PHP problems

    This is only part of the code, the bit that sends the mail. This works most times, but stops sometimes.
  4. You could use <div style="opacity: 0.3;">Opacity Bit here <div style="opacity: 1;">Normal</div></div> should work, i think.
  5. I'm not 100%, but if you use a normal log in form, with a checkbox, you need to check that the log in is valid, the checkbox for remember me has been ticked, then you need to use $_COOKIE['auto'] == "true"; then on your website, use <?PHP if($_COOKIE['auto'] == "true") { if logged in stuff here } else { } ?> I think this is right. You might want to check it first though.
  6. What cpanel do you use as a reseller cp? Does your form use PHP variables? if you have access to the database for your reseller cp, you need to use PHP to get values from the form, and insert them into the database.
  7. I would use PHP if i were you in this situation, it has more flexibility and you could use HTML mail, to style the email, using values from the PHP form. Let me know if you need examples of code for your solution. I'll be sure to help.
  8. I think of Div as a container. I normally use CSS (#divName) and specify the styling options such as width, height, position and other variables. Then use it in my HTML, <div id="divName">Hello</div> I hope this helps.
  9. Personally I dont' see anything wrong with that. It's up to you and the way you want to use it, you could use normal divs, but I would be likely to use section and article.
  10. MarkT

    PHP problems

    Can anyone help? I've logged out and logged back in, and after a few times of logging in/out it works, but it's long winded and would prefer a better resolution. Thanks.
  11. MarkT

    PHP problems

    if($_GET['action'] == "send") {$send = $_POST['to'];if($_POST['to'] == "ALL") {$send = $_POST['to'];$subject = $_POST['subject'];$from2 = $_POST['email'];$content = $_POST['content'];$team = $_POST['to'];$emails = mysqli_query($con,"SELECT * FROM parents WHERE global = '1'");$date = date("d-m-Y");$time = time();$user = $_SESSION['fname'];$user2 = $_SESSION['lname'];mysqli_query($con,"INSERT into email_logs (user, send_to, content, date_sent, time_sent) VALUES ('{$user} {$user2}','{$send}','{$content}','{$date}','{$time}')");while($results = mysqli_fetch_array($emails)) {$toemail = "{$results['email_address']}";$subject = "{$subject}";$message = "<html><head> <title>{$subject}</title></head><body>{$content}<br /><font color='red'><strong><h2>Regards</font> <br>Ditton Minors FC</h2></strong></body></html>";$from2 = $_POST['email'];$from = "{$from2}";$headers = 'MIME-Version: 1.0' . "rn";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";$headers .= "Bcc: ".$toemail."rn";$headers .= "From: admin@dittonminorsfc.co.ukrn";mail($to,$subject,$message,$headers);echo "<h1 style='color: #00FF00;'>Email Sent Successfully</h1><meta http-equiv='refresh' content='2;url=adminemail.php'>";}} else {$send = $_POST['to'];$subject = $_POST['subject'];$from2 = $_POST['email'];$content = $_POST['content'];$team = $_POST['to'];$emails2 = mysqli_query($con,"SELECT * FROM parents WHERE team = '{$team}'");$date = date("d-m-Y");$time = time();$user = $_SESSION['fname'];$user2 = $_SESSION['lname'];mysqli_query($con,"INSERT into email_logs (user, send_to, content, date_sent, time_sent) VALUES ('{$user} {$user2}','{$send}','{$content}','{$date}','{$time}')");while($results2 = mysqli_fetch_array($emails2)) {$toemail = "{$results2['email_address']}";$subject = "{$subject}";$message = "<html><head> <title>{$subject}</title></head><body>{$content}<br /><font color='red'><strong><h2>Regards</font> <br>Ditton Minors FC</h2></strong></body></html>";$from2 = $_POST['email'];$from = "{$from2}";$headers = 'MIME-Version: 1.0' . "rn";$headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";$headers .= "Bcc: ".$toemail."rn";$headers .= "From: admin@dittonminorsfc.co.ukrn";mail($to,$subject,$message,$headers);echo "<h1 style='color: #00FF00;'>Email Sent Successfully</h1><meta http-equiv='refresh' content='2;url=adminemail.php'>";}}}?>
  12. MarkT

    PHP problems

    Hello, I have a script in my website, which is used to send emails, however it's not working. You log in with sessions, and then you go to a form, which then echos: Send successful, but it doesn't actually send or complete t he SQL query to log it, it sometimes works, sometimes doesn't. Thanks in advance.
  13. My target="_blank" works in a new tab, but I don't see why you need a new window. If I'm honest.
  14. You can do it in HTML. It's using the target attribute. For example; <a href="#" target="_blank"> does a new tab or window. _blank Opens the linked document in a new window or tab _self Opens the linked document in the same frame as it was clicked (this is default) _parent Opens the linked document in the parent frame _top Opens the linked document in the full body of the window framename Opens the linked document in a named frame Source; http://www.w3schools.com/tags/att_a_target.asp
  15. MarkT

    PHP Str_replace

    Is there a way to use multiple values for the in_array bit?
  16. MarkT

    PHP Str_replace

    Can you show me an example please, using the word; "hate" for example.
  17. MarkT

    PHP Str_replace

    Hello, I want to create a posting system for my website, where if the post contains a certain word, then it stops the SQL query that puts it into the database, or at least stops it. Thanks
  18. MarkT

    PHP Sessions & $_GET

    It shows the right thing on every page, until you load the team page, then it overwrites it.
  19. MarkT

    PHP Sessions & $_GET

    That is set on the login script, from a value set by the database.
  20. MarkT

    PHP Sessions & $_GET

    Here's the other navigation code where the problem occurs: <?PHP if(isset($_SESSION['loggedin'])) {echo "<div id='membermenu'><ul> <li class='active'><a href='myprofile.php'><span>My Profile</span></a></li>"; if($_SESSION['ismanager'] == "1") { echo " <li><a href='playerprofiles.php?team={$_SESSION['team']}'><span>Player Profiles</span></a></li> <li class='has-sub'><a href='#'><span>Team Management({$_SESSION['team']})</span></a> <ul> <li><a href='editteam.php'><span>Edit Team</span></a></li> <li><a href='viewparents.php?team={$_SESSION['team']}'><span>View Parents</span></a></li> <li><a href='adminemail.php'><span>Send Emails</span></a></li> </ul> </li>"; } else {}; if($_SESSION['reporter'] == "1") { echo " <li><a href='writereport.php'><span>Write Match Report</span></a></li>"; } else {}; if($_SESSION['isadmin'] == "1") { echo " <li class='has-sub'><a href='#'><span>Shop Management</span></a> <ul> "; echo "<li><a href='shop.php?action=add'><span>Add Product</span></a></li>"; echo " <li><a href='pricerequests.php'><span>View Orders</span></a></li> </ul> </li>"; } if($_SESSION['isadmin'] == "1") { echo " <li><a href='playerprofiles.php'><span>Player Profiles</span></a></li> <li class='has-sub'><a href='#'><span>Administrator Tools</span></a> <ul> <li><a href='mass.php'><span>Mass Alert</span></a></li> <li><a href='writearticle.php'><span>Write News Article</span></a></li> <li><a href='adminemail.php'><span>Send Email</span></a></li> <li><a href='playerprofiles.php'><span>Player Profiles</span></a></li> </ul> </li>"; } echo " <li><a href='logout.php'><span>Logout</span></a></li></ul></div>";} else {}?> Probably not the neatest code, but it's good enough for me. The team management ($_SESSION['team']) is where it goes wrong.
  21. MarkT

    PHP Sessions & $_GET

    <div id='cssmenu'><ul> <li class='active'><a href='index.php'><span><img src="./images/home.png" align="left" style="padding-top: 12px; padding-right: 3px;" title="Ditton Minors FC :: The Future's Bright!" alt="Ditton Minors FC :: The Future's Bright!">Home</span></a></li> <li class='has-sub'><a href='#'><span><img src="./images/about.png" align="left" style="padding-top: 12px; padding-right: 3px;" title="About Ditton Minors FC" alt="About Ditton Minors FC"><span>About Us</span></a> <ul> <li class='has-sub'><a href='#'><span>Staff</span></a> <ul> <li><a href='committee.php'><span>Committee</span></a></li> <li class='last'><a href='officials.php'><span>Officials</span></a></li> </ul> </li> <li><a href='trophies.php'><span>Trophy Cabinet</span></a></li> <!-- <li><a href='history.php'><span>Club History</span></a></li> --> <li><a href='sponsors.php'><span>Sponsors</span></a></li> <li><a href='gallery.php'><span>Our Gallery</span></a></li> </ul> </li> <li class='has-sub'><a href='#'><span><img src="./images/calendar.png" align="left" style="padding-top: 12px; padding-right: 3px;" title="Ditton Minors FC Soccer Schools!" alt="Ditton Minors FC Soccer Schools!">Events</span></a> <ul> <li><a href='millwall.php'><span>Millwall Soccer School</span></a></li> <li><a href='soccerschool.php'><span>Summer Soccer School</span></a></li> <li><a href='tournament.php'><span>Ditton Minors Annual Tournament</span></a></li> </ul> </li> <li class='has-sub'><a href='#'><span><img src="./images/team.png" align="left" style="padding-top: 12px; padding-right: 3px;" title="Ditton Minors FC :: Meet The Teams!" alt="Ditton Minors FC :: Meet The Teams!">The Teams</span></a> <ul> <li><a href='team.php?team=MINI'><span>Mini Minors</span></a></li> <li><a href='team.php?team=U7'><span>Under 7's</span></a></li> <li><a href='team.php?team=U8'><span>Under 8's</span></a></li> <li><a href='team.php?team=U9'><span>Under 9's</span></a></li> <li><a href='team.php?team=U10'><span>Under 10's</span></a></li> <li><a href='team.php?team=U11'><span>Under 11's</span></a></li> <li><a href='team.php?team=U12'><span>Under 12's</span></a></li> <li><a href='team.php?team=U13'><span>Under 13's</span></a></li> <li><a href='team.php?team=U14'><span>Under 14's</span></a></li> <li><a href='team.php?team=U16'><span>Under 16's</span></a></li> <li><a href='team.php?team=U18'><span>Under 18's</span></a></li> <li><a href='team.php?team=MENS'><span>Senior Mens</span></a></li> </ul> </li> <li><a href='player.php'><span><img src="./images/player.png" align="left" style="padding-top: 12px; padding-right: 3px;" title="Ditton Minors FC :: Meet The Players!" alt="Ditton Minors FC :: Meet The Players!">Players</span></a></li> <li><a href='shop.php'><span><img src="./images/shoppingcart.png" align="left" style="padding-top: 12px; padding-right: 3px;" title="Ditton Minors Merchandise Store!" alt="Ditton Minors Merchandise Store"><strong>Shop</strong></span></a></li><!-- <li class='last'><a href='#'><span><img src="./images/contact.png" align="left" style="padding-top: 12px; padding-right: 3px;" title="Contact Ditton Minors FC" alt="Contact Ditton Minors FC">Contact Us</span></a></li> --> <li class='has-sub'><a href='#'><span><img src="./images/member.png" align="left" style="padding-top: 12px; padding-right: 3px;" title="Contact Ditton Minors FC" alt="Contact Ditton Minors FC">Member's Area</span></a> <ul> <li><a href='login.php'><span>Login</span></a></li> <li><a href='register.php'><span>Register</span></a></li> </ul> </li></ul></div> Navigation ^^
  22. You could look at using Ajax PHP, possibly. Take a look; http://www.w3schools.com/php/php_ajax_php.asp
  23. MarkT

    PHP Sessions & $_GET

    It's used in the navigation, and the navigation says Team Management (U11) but when I load the team.php?team=U7, it overwrites it to say Team Management (U7) which then affects the rest of the site.
  24. So you're saying they should be typed in>?
×
×
  • Create New...