Jump to content

Steve Scrimpshire

Members
  • Posts

    101
  • Joined

  • Last visited

Everything posted by Steve Scrimpshire

  1. Since others here posted info about great books, I will post a link. This is how I learned: http://www.php.net/manual/en/ Contributors' comments help clarify things (when reading posted comments, remember they read from bottom up and when people say 'the poster above' they really mean 'the poster below')
  2. Heh. Sorry to reply to myself, but edit time had passed. It helps if you set the path to your database correctly.
  3. I have created a form with a DataGridView that is connected to the appropriate DB and I created a Sub that allows me to edit a row. Once the row is edited, I can see the appropriate changes are made to the DataGridView, but when I close the form and fire it back up, the table is back to its original state before the changes. I have googled and googled and cannot find the right command to actually commit the changes to the DB. Can someone give me a little push? My database is named MyBusiness with one table called Customer. My form is using MyBusinessDataSet and CustomerTableAdapter.
  4. Well, it's not free. You pay like $5.95+ a month for it (and the php, and the bandwidth, and the space, and the awesome service...etc).
  5. I guess you just have to listen to them talk. Somebody there was running install scripts and needed help with config for a bunch of servers. That's all I know.
  6. The TCH guys were talking about install scripts and stuff and when I got online they started talking really vague and telling each other to 'go to the other channel'. I think they are planning something else, but when I asked they told me they couldn't say anything yet.
  7. These are all awesome, awesome, awesome (except for the last one). I give TCH 3 thumbs up.
  8. 11pm EST (Eastern Standard Time US) is a little less than one hour from now or GMT - 5 hours.
  9. The "Largest Announcement" is that the announcement has been postponed indefinitely. Sorry to spoil it for you.
  10. They do this knowing full well that we are gonna ask "When is the announcement?" and then say "When we announce it".
  11. I was not aware that she was planning on emailing these images. Maybe it's not as simple as it sounds. I created a form for my own uses using PHP for uploading an image and it could be easily adapted for more images and form fields, I thought. It has multiple checks of mimetype and size for security purposes.
  12. I have seriously thought about flashing an OpenSource Linux firmware in there.
  13. Thanks for the suspense. [wild guess]Bill is gonna take spelling lessons?[/wild guess]
  14. I won't be much help, but I run an SMF Board with maybe 10 active users (25 total) and an average of 4.05 posts per day. Bandwidth usage is about 55 MB/month. Sorry that doesn't help much. I don't know if you can assume 25 times the posts will be 25 times the bandwidth.
  15. If it is as simple as it sounds, let me know exactly what you need (be specific) and I might be able to whip one up for you. I'm out of school for the next few weeks. I cannot absolutely guarantee that I could do it, but I will give it a shot. Please don't be upset if I can't get to it or don't have the knowledge.
  16. To comment a line out in PHP, you put // at the very beginning of the line. Or put /* around the line like this */ So, what exactly is wrong with using GD Bibliothek? As the default setting it works perfectly fine (for my test run), so an older lady or man or your younger wife would have no problems as far as I can see. Maybe my inexperience doesn't provide me with the knowledge of what benefits ImageMagick would give you, but if it is important to you, you can try going to the 4Images website and asking them if there is anyway to get ImageMagick to work with open_basedir set to /home/username/:/usr/local/sqmail/:/usr/lib/php:/usr/local/lib/php:/tmp on a shared server. As far as Fantastico goes, it can't account for every possible server configuration and probably comes with the ability to install all those scripts you see by default. The fact that Fantastico is there at all makes life a whole lot easier. Maybe if you ask, they can disable Fantastico for you in your cPanel.
  17. Maybe this'll get you started: ><?php $username = "username"; $password = "password"; $database = "database"; $table = "table"; // Connecting, selecting database $link = mysql_connect("localhost", "$username", "$password") or die('Could not connect: ' . mysql_error()); echo 'Connected successfully'; mysql_select_db("$database") or die('Could not select database'); // Performing SQL query $query = "SELECT * FROM $table"; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); // Printing results in HTML // echo "<table>\n"; echo "<html><body>"; echo "<p>"; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { foreach($line as $key => $value) { echo "\$$key == $value"; echo "<br>"; } echo "<p>"; } echo "</body></html>"; // Free resultset mysql_free_result($result); // Closing connection mysql_close($link); ?> When I have more time, if you still haven't figured the rest out, I might be able to look deeper into it. Although, you could just use phpmyAdmin in your controlpanel: http://yoursite.com:2082/3rdparty/phpMyAdmin/index.php
  18. Just a quick glance because I don't have much time tonight, but a few lines below your error line, there is a function that looks like this: Note the bold variable name. I don't know if that was just a typo while putting the code here or if it is a typo in your actual code, but it might be worth looking into. Soon, I may have more time to give it an indepth look. P.S. If you put your code example inside [ code] [ /code] tags (without the extra spaces, of course) in the forum, your code will stay formatted correctly and be easier to read. Of course, if you want to bold or underline something in your code, you'll have to use [ quote] [ /quote] tags instead, in which case, you'll lose your formatting.
  19. Here's an example of a script I use to keep track of page reads. It uses php-gd, a 1x1 pixel transparent pixel and an alteration to my .htaccess file so I can name the file whatever.png and it still executes as a php script. The only output of the script is the blank.png and the rest is just commands that are executed in the background every time the page loads with the blank.png in it. In your case, you could have it output the ad image and for the link, you could redirect it to another php page briefly that logs the click then redirects them to the ad's site. That way you would have a log of views and a log of clicks. My particular script just creates and updates a counter file and a file that keeps track of ip addresses so I'm not counting the same ip address twice (in case the viewer leaves the page and comes back). I could easily update this script for you to do what you need if you like it. Here's my script as I use it: ><?php $counter_file = "counter6.txt"; $ipaddresses = "ipaddresses6"; $script = "Fibonacci"; $submitted_email="myaddress@myisp.com"; $to_email="otheremail@myisp.com"; if (getenv("HTTP_CLIENT_IP")) { $ip = getenv("HTTP_CLIENT_IP"); } else if (getenv("HTTP_X_FORWARDED_FOR")) { $ip = getenv("HTTP_X_FORWARDED_FOR"); } else if(getenv("REMOTE_ADDR")) { $ip = getenv("REMOTE_ADDR"); } else { $ip = "UNKNOWN"; } $isthere = "0"; $somecontent = "$ip\n"; $filestuff = file("$ipaddresses"); foreach ($filestuff as $line_num => $line) { $line = trim($line); $ip = trim($ip); if ($line === $ip) { $isthere = 1; } } if ($isthere == "0"){ if (is_writable($ipaddresses)) { if (!$handle = fopen($ipaddresses, 'a')) { echo "Cannot open file ($ipaddresses)"; exit; } if (fwrite($handle, $somecontent) === FALSE) { echo "Cannot write to file ($filename)"; exit; } } // Open the file for reading if (!($fp = fopen($counter_file, "r"))) die ("Cannot Open Counter file: $counter_file."); // Read 20 characters from the file $counter = (int) fread($fp, 20); // Close the file fclose($fp); // Increment the counter $counter++; // Open the file, in write mode $fp = fopen($counter_file, "w"); // Write the new value of counter to the file. fwrite($fp, $counter); // Close the text file. fclose($fp); $hostname = gethostbyaddr($ip); mail("$to_email", "Someone viewed $script", "IP address: $ip\nHostname: $hostname\nIt has now been viewed $counter times. Cool!\n","From: $submitted_email") or die("error"); } //ini_restore(sendmail_from); Header ("Content-type: image/png"); Header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0"); Header("Expires: Thu, 19 Nov 1981 08:52:00 GMT"); Header("Pragma: no-cache"); $img = @ImageCreatefromPNG("blank.png"); ImagePNG($img); ImageDestroy($img); ?> Of course, if you have a lot of banners/ads, you may want to keep track of the statistics in a database rather than a flat file like I do here.
  20. This is an awesome gift. Such a generous hosting company...no wonder I stick around. I hope the glitches with this script don't get them to rescind the offer.
  21. Hmmm. Apparently I waited too long to try and edit. It looks fine in IE6. The logo image is the same size in all 3 browsers, so that's not the issue. It's the other table cells or <divs>, or whatever it's using, that are actually smaller in the other two browsers, putting them behind the image.
  22. Dunno if this is being worked on still, but the header/links are all funky to me in both Firefox 2.0 and Opera 9.02. Screenie: http://semperphi.com/images/tch-header.gif
×
×
  • Create New...