Jump to content

desjardins2010

Members
  • Posts

    187
  • Joined

  • Last visited

Everything posted by desjardins2010

  1. I include connection file at the top this page that sets my connection $con = mysqli_connect("$host","$user","$password","$database");
  2. $user_query = "SELECT * FROM `referrals`"; $user_querys = $con -> query($user_query); $count_query = $user_query -> num_rows; if ($count_query !=0) { while ($row = $user_querys -> fetch_assoc()) { $id = $row['id']; $REG_DATE = $row['regdate']; $username = $row['username']; $refd_user = $row['refd_user']; $commission = $row['commission']; $acct_status = $row['acct_status']; anyone tell me why this Trying to get property of non-object is happening on line $user_querys = $con -> query($user_query);
  3. Hey Me again; when storing data to mysql db i want to ensure it's safe the data I need to store is HTML code so in essence could be awhole page of html depending on what the user creates - I want them to be able to paste there html code store it and have it displayed on a page.. so would I just be ok using htmlentites() or something else or something in addition? and have it not loose it's html properties
  4. Sweet that worked perfect thanks Barand
  5. Ok this worked BUT one more question regarding this I notice that I get alot of sites that are the same CORE site but different appending ID's so they showing as different sites... is there an easy way to just match the www.something.com and leave our the ?asdfmsdmfs just curious no biggy I can handle if not
  6. yes this would work mentioned early on by Ansego but as cyberRobot said POST too can be messed with but way more secure than what your doing now..
  7. I'm trying to structure this query properly but failing with all attempts. i have a table that has 5 fields id, http_referrer,ip,hit,today what I want to do is query this table to show me all the http_referrer's GROUPED up so only 1 row for ALL say 255 results that came from www.google.ca and the SUM'd hits so RFERRER HIT google.ca 255 phpfreaks.com 15 I tried SELECT SUM(hit) as 'hits' FROM `global_stats` GROUP BY `http_referrer` this don't work
  8. hey josh regarding your comment above and considering I'm currently attempting to build myself a better mass mailer can you justify for me what is considered proper headers... I mean is there a cut rope method to ensure your emails get through - relevant of course to the content in the mail inself
  9. guys I'm trying to get this script to work and thus far whats happening is 1) when I hit send I get flooded with the script I'm running is simply looping through the emails found in the members table and instead of sending mail I just echo and it supply all the emails - what am I doing wrong..? <?php //MASS MAILER FOR REFERRALCATCH.COM //CODE CREATED MARCH 14th 2014 //DESJARDINS MEDIA INC // INCLUDE CONNECT FILE include '../inc/connect.php'; //****************IF FORM WAS SUBMITTED LETS LISTEN FOR THAT************// if ($_SERVER['REQUEST_METHOD'] === 'POST') { //if the post is active lets make sure that all the fields were filled in if (!isset($_POST['subject']) || !isset($_POST['message'])) { //then all fields were not set and must show an error $errors[] = "Sorry you must enter both fields"; //END if (!isset) }else { //both fields were set now we have to clean them up a bit $subject = trim(htmlspecialchars($_POST['subject'])); $message = trim(htmlspecialchars($_POST['message'])); $message = wordwrap($message, 70, "\r\n"); // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Mail it loop through members $grab_emails = "SELECT * FROM `members` WHERE `Activation` = 'NULL'"; $ex_grab = $con -> query($grab_emails); while ($row = $ex_grab -> fetch_assoc()) { $email = $row['Email']; $to = $email; $headers .= 'To: '.$email . "\r\n"; $headers .= 'From: admin@REMOVED.com' . "\r\n"; //send the mail $send = mail($to, $subject, $message, $headers); if ($send) { echo "<font size='6' color='Green'>.</font>"; }else { echo "<font size='6' color='red'>.</font>"; } } //end $_SERVER['REQUEST_METHOD'] } } //****************FIND NUMBER OF VALID EMAILS TO SEND TO ****************// $query_avail = "SELECT * FROM `members` WHERE `Activation` = 'NULL'"; $ex_query = $con -> query($query_avail); $ex_count = $ex_query -> num_rows; /****************** END MEMBER COUNT ***********************************/ ?> <!-- FORM FEILDS FOR EMAIL MESSAGE CREATION--> <table> <div class="member_count">There are currently <?php echo $ex_count; ?> users that can be sent emails.</div> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> <tr> <td>Subject:</td><td><input size="36" ="" type="text" name="subject"></td> </tr> <tr> <td valign="top">Message:</td><td><textarea cols="60" rows="10" name="message"></textarea></td> </tr> <tr> <td></td><td><input type="submit" name="submit" value="Process"></td> </tr> </form> </table>
  10. Ok I understand what your saying I just don't understand how you take an entry from a form in this case $_POST['startdate'] that is carrying the value 2014-03-11 and have it changed to 03-11-2014 to store? I'm know strtotime() and date() but not sure how you would use them to alter the date format..
  11. i felt the need to reply cause I'm a little confused hence the need for a help forum - where i'm getting lost is and mentioned above the format that the input type=date TAKES is m-d-y <-- this is how I want it to stay - when you process the form it gets stored in Y-m-d my question is I'm storing to DB in varchar is that wrong? and if thats the case how do I convert from Y-m-d to m-d-y
  12. <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { $siteName = $_POST['sitename']; $siteName = trim(htmlentities($siteName)); $dest_url = $_POST['url']; $dest_url = trim(htmlentities($dest_url)); $start_date = $_POST['startdate']; $start_date = trim(htmlentities($start_date)); $end_date = $_POST['enddate']; $end_date = trim(htmlentities($end_date)); $imageurl = $_POST['imageurl']; $imageurl = trim(htmlentities($imageurl)); $insert = "INSERT INTO `adverts` (siteName,dest_url,start_date,end_date,imageurl) VALUES ('$siteName','$dest_url','$start_date','$end_date','$imageurl')"; $insertquery = $mydb->query($insert); if ($insertquery) { $completed = true; } //end first if } ?> <div class="admin_wrap_rhs_form"> <table> <b class="alert_t1"> <?php if ($completed == true) { echo "New advertisement added successfully"; } ?></b> <form action="" method="post" name="addsite" onsubmit="return (validatecontact());"> <tr><td>Site Name</td><td>:</td><td><input type="text" name="sitename" class="admin_inp1" placeholder="SiteName"></td></tr> <tr><td>Destination URL:</td><td>:</td><td><input type="text" name="url" class="admin_inp1" placeholder=" Destination URL"></td></tr> <tr><td>Start Date:</td><td>:</td><td><input type="date" name="startdate" class="admin_inp1" placeholder="01-01-2014"></td></tr> <tr><td>End Date:</td><td>:</td><td><input type="date" name="enddate" class="admin_inp1" placeholder="01-29-2014"></td></tr> <tr><td>100*100 Image URL:</td><td>:</td><td><input type="text" name="imageurl" class="admin_inp1" placeholder="http://www.domain.com/images/banner.gif"></td></tr> <tr><td colspan="3"><center><input type="reset" value="Reset" class="admin_but"> <input type="submit" value="Add Site" class="admin_but"></center></td></tr> </form> </table> <p style="margin-top: 10px; ">NOTICE: remember you can use your image hosting here for your banner ads also <a href="index.php?action=upload_img">HERE</a></p> </div> this is the code the data being supplied by userend is directly from the input date function -- it's storing in DB as 2014-03-11 but my compare is looking to compare m-d-y now when you select a date using the form input its in the m-d-y so am I doing something to the entry when trim(htmlentities()) to the string?
  13. i have this code http://pastebin.com/XBJxGw6L prob is when using the input type=date when selecting the date it's showing as m-d-y but it's written to the database as Y-m-d so my query is failing to compare dates as it's checking in the format i believe m-d-y ??
  14. can somone point out why this returns 1 for the count when I'm confident there is nothing in the database?? $query = "SELECT * FROM `testing`"; foreach ($dbconnect->query($query) as $row) { echo "USERNAME: " . $row['username'] . "-" . "PASSWORD: " . $row['password'] . "<br/>"; } $query2 = $dbconnect->query("SELECT * FROM `testing` WHERE `email` = '$email'"); $count = count($query2); echo $count; if ($count !=0) { echo 'Mate Your Already In The Database'; }else { $dbconnect->exec("INSERT INTO `testing` (id,username,password,email) VALUES ('','$username','$password','$email')"); echo 'Successfully Entere Into Database'; }
  15. echo "<tr><td>".$prog_name."</td><td><a href='".<?php echo htmlspecialchars($_SERVER["PHP_SELF"])?>."?id=".$title."'>EDIT</a></td></tr>"; what am I doing wrong - and could you please just explain my mistake so I can learn from it.. I know it's having to do with the "" and '' but I confuse on where to use them
  16. can you tell me this link below what proper way to include a php variable <iframe src="https://www.superrewards-offers.com/super/offers?h=hhyyhdhd.912853523890&uid=USER_ID" frameborder="0" width="728" height="2400" scrolling="no"></iframe> need to add $username to the USER_ID part I tried just <iframe src="https://www.superrewards-offers.com/super/offers?h=hhyyhdhd.912853523890&uid=$username" frameborder="0" width="728" height="2400" scrolling="no"></iframe> should that not work??? I thought it would but - superrewards app don't show and I thinking might be casue this is not bring in the username
  17. **Sorry if this not right place** I have a site that is being listed as having malware says https://www.virustotal.com/en/url/e9e30a278d107eda87b68a17d8b43f86c65515c43f0df630a78205cd625da1db/analysis/1388285181/ I have looked everywhere and don't know what is causing this... can anyone shed some light on this for me please..
  18. hey guys/gals I'm curious if anyone has any ideas here - I visit a site today that once I logged into the site it produced a popup with an offer.. I would like to mock the same tactic but can't figure out how... dunno if it's php or prob java sorry if this wrong post place
  19. can some help me with a small problem... I have a site that I want to create an admin section for that will allow the user to update a certain page with it's contents- thus far i'm ok cause more is just text and link however there is an image for each entry that I'm unsure how to store... I've been told it's unfair practice to store images in a DB and if that's true then storing them inside folders isn't a problem if that's how it's done - but if that is the case would I just include an upload script to put the image on the server and reference the image In the DB? and in that's the case what foundation would I use while building the DB structure would I use to store links to such images?
  20. great comment and I'm sure it's better option but I have no clue about DOMDocument so.... any chance in written me a little something and explaining how it works??
  21. Guys I'm trying to get a certain piece of info in the quickest possible way so the site don't load slow when fetching.. the site i'm getting data from is silverclix.com and the piece I wan't is the Total Paid and total Members at the top of the screen the pieces of info are in this list <!-- #statistics --> <div class="span8" id="statistics"> <section> <ul> <li class="total-paid">Total Paid: <span>$22,204.32</span></li> <li class="total-members">Total Members: <span>31912</span></li> <li class="users-online">Users Online: <span></span></li> </ul> </section> </div> <!-- #statistics ends --> and I have tried this... <?php $content = file_get_contents('http://www.silverclix.com/index.php'); preg_match('#<ul><li>(.*)total-paid</li></ul>#', $content, $match); $total_paid = $match[1]; ?> that hasn't worked so if anyone can help please
  22. i get an error Warning: mysql_query() expects parameter 1 to be string, resource given in /home/jeffdesj/public_html/clicker/index.php on line 71 $select = mysql_select_db("jeffdesj_clicker"); $result = mysql_query($connect,"SELECT * FROM `sites`"); while ($row = mysql_fetch_array($result)) { $header = $row['header']; $image = $row['image']; $date = $row['date']; }
  23. hey guys gals can someone tell me I'm setting up a DB that I want to hold an image how do I accomplish this in phpmyadmin?? second question is does anyone know of a way that I can set something up that will with a provided url take a screen shot of the site and store that image in the db say I setup an admin section that I enter these sites into to be stored... anyway of instead of providing the image i provide a url that when the script is ran it enters the details I provide into DB and takes screen shot and saves image for use later on
  24. problem is the site isn't accessible it's in a frame from goldenclix.com.... can't view source
×
×
  • 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.