Jump to content

Adika

Members
  • Posts

    84
  • Joined

  • Last visited

    Never

About Adika

  • Birthday 05/24/1983

Profile Information

  • Gender
    Male
  • Location
    Novi Sad

Adika's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hiding css source - not possible. What you can maybe do is to scramble it, so that it would be much harder to read. But for how to do it, google a little. :-)
  2. Great to hear that you solved it. :-)
  3. Sorry, but I can't fix big things for free because it's time consuming, and time is money. But what I can do is put you in the right direction, so you can find the solution yourself. So, open the func.php, and find the line where it says function user($some_variable_will_be_here) { That line is feeding your $usr with data. Follow that function line by line, and found out what he does. For functions or words that you don't know what they mean, go to the www.php.net and "search for" box write in the word that you don't understand. And then click the arrow. Then it will show you the function that you didn't know, and how it's built and for what it is. That way you can understand your code. Hey, no pain no game! And if you are not here to learn php, than what are you doing here? And learning php is not just asking questions in the forums, but trying to find answers yourself. And php.net is the best way to find answers, since that's all you need (mostly). And since php is the easiest language to learn, spend some time, and learn it. My first language was also php and I learned everything by myself from php.net and by analyzing the script. If you have some questions, I will be happy to ask or to direct you to the right direction. And let me tell you one more thing: If you spend some time to completely understand this script that you are working on, you will gain instant knowledge of php, and after that you will see how easy this language is, and how good you can be in it in no time. Trust me, I was there where you are now before.
  4. Just add this: $coms1 = mysql_num_rows(mysql_query("SELECT * FROM `blog` WHERE `id`='$bid'", $conn)); Under this line: $bid = $row["bid"]; $date = $row["date"];
  5. Change this line: if (($strpos !== false) && ($strpos == 0)) { to this one: if ($strpos !== false) {
  6. Ok, this problem requires step by step debugging. First: $usr=user($_SESSION["user"][0]); Explain me the above line of code. It needs to catch how many points does the user have, and he is doing it when the user enters the page. So, to do it, the script must connect to the database somewhere to get the points number. Since user() is some kind of custom function, explain me where is it and what is he doing.
  7. It's a temporary problem against spam, because the spam bots generate different IPs every time they attack. And soon your ip blocking list can grow to the hundreds of records, and you will keep getting a lot of spam (in case your site becomes very popular). I know this because I had a guestbook on one of my websites that was doing that ip blocking thing, and he never managed to keep spam away. What was even worse is that the same spam message appeared again and again during the week but from different IP address. After I installed a simple captcha, the spam was minimal, only one or two every two weeks. Before, it was one or two every day. The site was never big enough to test it fully against spam, but captcha is more better than any IP blocking script. And it's better if you have even the simplest anti spam technology (captcha or the Answer a question (if this works at all, since I never tried it)) than if you don't have none, because ip blocking is NOT an anti spam techology any more. :-)
  8. The problem must be in your From header. Try using this From header: "From: ".$visitormail."<mysitemail@yahoo.com>". "\r\n"; instead of this one that you used: "From: $visitormail\r\n";
  9. Do you know how to send mail with php? If you don't than check out the mail() function from php.net If you have some questions about it after you checked out that function, then write me. Let's put your download page into single file, so when the user submits the form, the mp3 link will still show himself on this page. So, this page will be feedback.php Let's code it all in one file. :-) Here is the complete, ready to be tested, feedback.php page. Just copy all the code and save it as feedback.php and test it. <html><head><title>My websites name</title></head><body> <?php if(!isset($_POST['Submit'])) {?> <form action="feedback.php" method="post"> <table width="350" border="0" align="center" cellpadding="1" cellspacing="1" summary="mailing list"> <tr> <td height="24" colspan="2" valign="middle" class="font"><p> </p></td> </tr> <tr> <td height="24" colspan="2" valign="middle"><div align="center"> <p><span class="font"><img src="bss.jpg" width="350" height="350" alt="bss" /><br /> </span></p> </div></td> </tr> <tr> <td height="25" colspan="2" valign="middle"><span class="font">Join our mailing list to download our new track "Lies" for free!!</span></td> </tr> <tr><td width="105"><span class="font"> <label for="name">Name</label> :</span></td> <td width="232" align="right"><span class="font"> <input type="text" name="name" id="name" size="25" /> </span></td> </tr> <tr><td><span class="font"> <label for="email">Email address</label> :</span></td> <td align="right"><span class="font"> <input type="text" id="email" name="email" size="25" /> </span></td> </tr> <tr> <td> </td> <td align="right"><span class="font"> <input name="Submit" type="submit" value="Get it" /> </span></td> </tr> <tr> <td colspan="2" class="line"> </td> </tr> <tr> <td colspan="2" align="center" class="font"><span class="font"><a href="http://www.myspace.com">Return to our mySpace</a></span></td> </tr> </table> </form> <?php } else { // since I have some free time, I will provide you the code for mail sending $name = $_POST['name']; $email = $_POST['email']; // Lets create the mail first $subj = "New subscriber"; $to = "myemailaddress@somewhere.com"; $message = "New subscriber! Name: ".$name."\n\rEmail: ".$email; mail($to,$subj,$message); ?> Put here your download page html. The rest is just a simple example..... <br><br><br>Download my music <u>The link to my music</u>. This is pure html stuff, so you know what to put here. :-) <?php } ?></body></html>
  10. But after you updating the database, the user will still have 10 points and can never have less than 10. - from your code $poang = $userrow['points']-10; $query = "UPDATE users SET points=points+$poang WHERE id='".mysql_real_escape_string($_SESSION["user"]["0"])."' LIMIT 1"; mysql_query($query, $db_id); The above is that code. Still a mystery number. I think Scooby-Doo will find out what's happening there. :-) $poang = $userrow['points']+100; $query = "UPDATE users SET points=points+$poang WHERE id='".mysql_real_escape_string($_SESSION["user"]["0"])."' LIMIT 1"; mysql_query($query, $db_id); The above code answers your above question. :-) The answer is in this line of the code: if($usr[7]>=10){ I wonder what field does $usr[7] stands for?
  11. Your table is good, your php is good (it reads and writes in the database) but you also have an ip_address field in your database which you did not use in your php code provided in this site. (One note: $sql="select count from page_counter where article_id='".$article_id."'"; $count=0; $count_result=mysql_query($count_sql); Instead of this, you must put this for this script to work: $count_sql="select count from page_counter where article_id='".$article_id."'"; $count=0; $count_result=mysql_query($count_sql); ) If you are catching every visitors ip and before you update the database, you check if that user didn't already read that article, than you are safe from bots. Because the script that you showed us, are not doing that. What this script does is to raise the number every time you reload the page which is a big NO NO!
  12. Sorry, I forgot to tell you, change this code: $poang = mysql_fetch_array($result); to this one: $myNum = mysql_fetch_array($result); $poang = $myNum[0] And also add LIMIT 1 in your select sql statement just like you did in the Update statement, since you only getting out one record, so it's an extra security.
  13. Is that means that it is working now?
  14. Here is the code how to do it, but first you need to have 2 pages: One with a form on it, and the other page where the link for the free mp3 will be. Let's call the first page form.html and the next one mp3.html so that you can understand the code more easily. :-) What we will do is to call the form.html or the mp3.html in the same page when the user submits the info. On the form.html page you have a form with your fields and stuff. Find this line in your code: <form action="the_page_where_the_form_will_be" method="POST"> Change the "the_page_where_the_form_will_be" with the name of the page where you will put your form.html in. After your changed that, find the code for the submit button. It goes something like this: <input type="submit" name="some_name_will_be_here" value="some_value"> Remember the "some_name_will_be_here", because you will need soon. Now, on your index page, or whatever page you will put your form, insert this code where you want your form (this is php, by the way): <?php if(!isset($_POST['some_name_will_be_here'])) { include "form.html"; } else { include "mp3.html"; } ?> Did I say it's done? Well, now I say it. This is all the wisdom. :-) I hope you understand everything. :-) If it's your band, I hope you will have a lot of subscribers! :-) Cheers!
  15. If your code is working great, then try putting that sql statement here: if (isset($antal) && !empty($antal)) { foreach($_POST{'siffra'} as $tal) { if(is_numeric($tal)) { $gissningar .= ' '.$tal; if($tal==$slump) { $poang = $userrow['points']+100; $query = "UPDATE users SET points=points+$poang WHERE id='".$_SESSION["user"]["0"]."' LIMIT 1"; mysql_query($query, $db_id); } else { $poang = $userrow['points']-10; $query = "UPDATE users SET points=points+$poang WHERE id='".$_SESSION["user"]["0"]."' LIMIT 1"; mysql_query($query, $db_id); } } } } [color=red]$query="SELECT points FROM users where id='".$_SESSION["user"]["0"]."'"; $result = mysql_query($query, $db_id); $poang = mysql_fetch_array($result);[/color] if($gissningar!='') { $skrivut .= 'You guessed '.$gissningar.'. '; } if($poang<=0) { $skrivut .= '<b>You don\nt have any points left!</b>'; } else { $skrivut .= 'You have '.$poang.' points.'; }
×
×
  • 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.