
wolfrat
Members-
Posts
21 -
Joined
-
Last visited
Never
Contact Methods
- MSN
-
Website URL
http://viralcoders.com
Profile Information
-
Gender
Not Telling
wolfrat's Achievements

Newbie (1/5)
0
Reputation
-
[SOLVED] very strange problem with update statement
wolfrat replied to wolfrat's topic in MySQL Help
You're right I feel stupid now, I thought I would never need to know about reserved keywords. -
Hey everyone, am making a simple clicktracker sort of thing, and am running into trouble updating the system. This is the statement I use (id is already sanitized, afila is the name of my table, and out is the column of 'click' values): UPDATE afila SET out=out+1 WHERE id='$id' However, when I try to execute that command, I get: and here is my table structure: -- phpMyAdmin SQL Dump -- version 2.10.0.2 -- http://www.phpmyadmin.net -- -- Host: ************ -- Generation Time: Jan 02, 2008 at 10:43 PM -- Server version: 5.0.41 -- PHP Version: 5.2.5 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; -- -- Database: `***data` -- -- -------------------------------------------------------- -- -- Table structure for table `afila` -- CREATE TABLE `afila` ( `id` int(3) NOT NULL auto_increment, `in` int(6) NOT NULL, `out` int(6) NOT NULL, `name` varchar(60) NOT NULL, `image` varchar(400) NOT NULL, `url` varchar(400) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; Any help would be much appreciated.
-
just have a nice long password, and always check the url before logging in to make sure you don't get phished. Also disable html in comments.
-
replace <tr> <td id="bold">Persons First Name<br> Persons Last Name </td> <td> </td> </tr> </table> with <tr> <td><strong>Persons First Name</strong><br> Persons Last Name </td> <td> </td> </tr> </table> Yeah I know it's not css, but sometimes simpler is better
-
[SOLVED] Retrieving data from mysql table using php
wolfrat replied to rinteractive's topic in PHP Coding Help
hmm, can you maybe view the page source of the generated html, and post here what it says in the image tag? And how are you storing the images in the sql, just the image name/location, or the actual image file? -
[SOLVED] Retrieving data from mysql table using php
wolfrat replied to rinteractive's topic in PHP Coding Help
Hmm, I'm not quite sure where your image tag was in there, but I'm guessing you want it in here: <tr bgcolor=\"#FFFFFF\"> <td align=\"center\">$num</td> <td align=\"center\"><input type=\"radio\" name=\"id\" value=\"$id\"></td> <td align=\"center\">$name</td> <td align=\"center\">$photo</td> If you just have the image name saved, you should do: <tr bgcolor=\"#FFFFFF\"> <td align=\"center\">$num</td> <td align=\"center\"><input type=\"radio\" name=\"id\" value=\"$id\"></td> <td align=\"center\">$name</td> <td align=\"center\"><img src=\"$photo\" /></td> -
You just had an unclosed <textarea> (not sure if that was your problem) It writes to the file ok (make sure that the file you are writing to has the correct permissions, if you aren't sure, just delete the submissions.txt file, php will make the file automatically with the correct permissions if the file does not already exist) You might also want to think about giving some feedback to the user to let them know when they've submitted the data successfully, otherwise they might keep clicking and fill up your data file <form method="post" > E-Mail:<input type="text" size="15" maxlength="30" name="e_mail"/> <br /> Rate how useful our ads were! <font size=2> 1= Terrible, 5=Great <font size=3> <select name="rate_useful"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> <br /> Rate the location of our ads on the webpage were! <font size=2> 1= Terrible, 5=Great <font size=3> <select name="position"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> <br /> Got Any Suggestions? <textarea rows="2" cols="20" name="suggestions"/></textarea><br> <input type="submit" name="click" value="click"/> </form> <?php $email = $_POST["e_mail"]; $use = $_POST["rate_useful"]; $position = $_POST["position"]; $comments = $_POST["suggestions"]; $suggestions = "../suggestions.txt"; $FH = fopen($suggestions, 'a+') or die("can't open file"); fwrite($FH,$email . ',Rate-Useful:' . $use . ',rate-position:' . $position . ',suggestions:' . $suggestions . '......'); fclose($FH); ?> seems to work for me
-
What exactly are you trying to do here? By making $url a function, do you mean, get functions from external pages and load them/save them into the php page? Or do you just want to make a function that makes it easier for you to download pages? (i.e. having something like download($page)
-
Ok, I'm not too sure about this, but couldn't this be insecure? As you are only checking the file extension, and seem to be uploading the file before resizing it (correct me if I'm wrong). So technically, if a user knew where the images where going to be uploaded, he/she could potentially upload malicious files. This is what I use in my image upload scripts to make sure that the uploaded file is an image: $imageInfo = getimagesize($_FILES['avatar']['tmp_name']); if (!in_array($imageInfo[2], array(2, 3))) { // tell the user that they can only upload valid images } else { //upload the image, resize, whatever } something like that anyway, it just checks to see if the script can find the dimensions of the image. And the @ in front of commands tells the php thing not to print out the error details, useful for mysql commands (you don't want everyone seeing your sql table structure in the event of an sql server outage or something)
-
Form to have on your page: <form action='addemail.php' method='GET'> <input name="email" type="text" /> <input name="submit" type="submit" /> </form> this php code should be in addemail.php (assuming the form above is used): <?php if (isset($_GET['submit'])){ $email = $_GET['email']; //adding a new line character so that each email address has its own line $email = "$email \n"; //opening the textfile for writing $textfile = fopen("emails.txt","a"); //writing the email fwrite($textfile, $email); //closing the textfile handle fclose($textfile); } ?> It's a very simple, basic script, but it will get the job done
-
You people are all so wrong. It was clearly programmed in fortran.
-
Hmm, I would probably advise against placing the ads at the top, because of 'header blindness', people are used to ads always being at the top of pages, so their eyes automatically see past the header.
-
Yup, as mentioned in the previous post, this site is running the Simple Machines Forum script. It's my favourite forum script, I use it on all my sites now. It's safe, there are very few exploits available for it, and there is a large amount of themes and plugins available for it.
-
AVG is definitely the best, and for windows servers, use nod32. Also AVG Anti-spyware is pretty good.
-
I wish m$ would just give up on internet explorer and bundle firefox with all copies of windows