Jump to content

desjardins2010

Members
  • Posts

    187
  • Joined

  • Last visited

Posts posted by desjardins2010

  1. $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);

     

     

  2. 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

  3. 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

  4. 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

  5. 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 

  6. 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

     

     

     


    This message was created automatically by mail delivery software.A message that you sent could not be delivered to one or more of itsrecipients. This is a permanent error. The following address(es) failed:  REMOVED@gmail.com    SMTP error from remote mail server after end of data:    host gmail-smtp-in.l.google.com [173.194.68.27]:    550-5.7.1 [192.196.156.24      11] Our system has detected that this message is    550-5.7.1 not RFC 2822 compliant. To reduce the amount of spam sent to Gmail,    550-5.7.1 this message has been blocked. Please review    550 5.7.1 RFC 2822 specifications for more information. v2si3915203qaf.102 - gsmtp------ This is a copy of the message, including all the headers. ------Return-path: <nobody@host.REMOVED.com>Received: from nobody by host.REMOVED.com with local (Exim 4.82)        (envelope-from <nobody@host.REMOVED.com>)        id 1WOX41-0002iv-G1; Fri, 14 Mar 2014 14:42:37 -0400To: REMOVED@gmail.comSubject: Reminder From ReferralCatchX-PHP-Script: www.REMOVED.com/admin/pages/mass_mail.php for 64.228.153.209MIME-Version: 1.0Content-type: text/html; charset=iso-8859-1To: desjardins2@REMOVED.comFrom: admin@REMOVED.comTo: USERSEMAIL@gmail.comFrom: admin@REMOVED.comMessage-Id: <E1WOX41-0002iv-G1@host.REMOVED.com>Date: Fri, 14 Mar 2014 14:42:37 -0400

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    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>
    
  7. 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.. 

  8. 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

  9. <?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?

  10. 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';
    }
    
    
  11. 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

  12. 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 

  13. 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

  14. 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?

     

     

  15. 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   

  16. 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'];
    			}
    
  17. 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

×
×
  • 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.