Jump to content

keldorn

Members
  • Posts

    340
  • Joined

  • Last visited

    Never

Everything posted by keldorn

  1. Yes the array_num was wrong. It returned (paraphrased): Error array_num expects Array The while() code Mikesta didn't work exactly. I put exit; inside the while() and it did not it get caught by it. But I do already have a While() just above it for a another slighty unrelated msyql_query. Could that interfere with it? Other then that $count += $line['hits']; works in the other while() loop. It returns 35759 hits. (from all the rows.) But I just want only the ones from today's date.
  2. Hello, okay I have lets just say I have 3 tables in a database one called "id" (auto-incrementing, Key thing-a-jig) "date", and one called "hits". Date is formatted as Year-month-day, hits is an integer. I want to grab only the Rows that are from "Today" and then cacluate the "hits" to a total numbers. So say you pull out of the database id:1 date:2009-09-09 hits:200 id:2 date:2009-09-09 hits:100 id:3 date:2009-09-09 hits:100 = 400 hits. How I can calculate all those 3 to a total number? Here is my code thus far. if(!$smarty->is_cached('index.tpl')) { $results = array(); $link = mysql_connect($CONFIG['mysql_host'],$CONFIG['mysql_user'], $CONFIG['mysql_pass']) or die('Could not connect: ' . mysql_error()); $db_selected = mysql_select_db($CONFIG['mysql_db'],$link) or die('Could not contact the database'); //Get Todays Date in year-month-day $date = date("Y-m-d"); // Only grab the rows where the date = today's $date. $Hits = mysql_query('SELECT * FROM links WHERE date=' . $date . ' ORDER BY id DESC LIMIT 0,500') or die('Could not connect: ' . mysql_error()); while ($line = mysql_fetch_assoc($Hits)) { $tmp[] = $line; } /// Begin Math problem to calculate the hits....? }
  3. Google has results for image/pjpeg problems. Gotta give your thanks to the geniuses at Microsoft. :-\
  4. Cross site scripting is when they pass some crap in your url like search.php?var=<script type="text/javascript">alert("lol xss!");</script> If you do not validate this input, then on the return page. Depending how your script works, say you might takes the input and place it in your html like Since that is real javascript, it will execute on the page. Now you have been haxored. Secondly if PHPFreaks forum did that validate that. Right now you see a alert box saying "lol XSS!". Another thing. If someone can get real HTML/javascript into your page. They could steal cookies and all kinds of nasties.
  5. Is this PHP related? But Use DNS A or CNAME records. Example: blogexample.com. => CNAME => Blog.somebloghost.com. blogexample.com. => A => IP address
  6. In short no it won't. Obscuring your form with Javascript/Ajax might stop the regural spam bot from seeing your form. But if a spammer wanted to target your site they could just examine your POST or GET method and specially craft the POST or GET and execute it.
  7. I tried runnng your code on my server and it worked. Except for the $_POST['submit']. I removed that and used the form you provided. (after removing the spaces) and it worked. Can I ask a question. Are you assigning "Submit" to your submit button thinking that it sends a variable called Submit and trying to check for it? The submit button doesn't do that. Its not necessary.
  8. Also //N/A Roof Height Only if (isset($_POST['Submit']) && isset($_POST['N/A'])) { q $RoofHeight."N/A"; } Is invalid. What is q? Thats not valid syntax. You might want to check that.
  9. Get rid of the isset($_POST['submit']) I'm guessing you thought you neeeded that. But if you dont have actually have a post variable called "submit" set. Am I right? Also remove the spaces from the name="" attributes. Turn "Standard Roof" to "StandardRoof" Edit: I see you do have a post var being sent called Submit.. But regardless you need to get rid the space(s) in the Input name="" attribute as PFMaBiSmAd said.
  10. Make sure you put the $_SESSION['leadid'] = $_GET['id']; to set the sesssion cookie when they first hit the login page. So the cookie is available when the hit post. (the cookie should get sent with their post?). I think that it should work or it might be becuase of the header redirect. I've heard that header(); can mess with sessions. So maby try this. //[...] $_SESSION['s_logged_n'] = 'true'; $_SESSION['s_username'] = $username; $_SESSION['s_name'] = $row['name']; $leadid = $_SESSION['leadid']; session_write_close(); header("Location: buy.php?leadid=" . $leadid); exit; }else{ //[...]
  11. I use Notepad++. Has good syntax highlighting and is lighting fast to start it and is tabbed, also doesn't have any memory leaks. I've left it open for days on end without closing it and have never had a problem with it. All I really need!
  12. Probably to comment spam. Automated video posting? Well I have never heard of anyone needed to upload videos with cURL. But usually these things when there automated = spam. Like running a bot with cURL to mass spam hundreds of pages a second or automate the upload of tons of spam videos. LOL
  13. Probably to comment spam.
  14. When they reach the "login" page. Save the Variable $leadid as a $_SESSION like $_SESSION['leadid'] = $_GET['id']; When they hit their POST and your script returns the new page, pass the $_SESSION['leadid'] as header("Location: buy.php?leadid=" . $_SESSION['leadid']); How about that? I think it would work if I'm understanding correctly.
×
×
  • 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.