Jump to content

aquatsr

Members
  • Posts

    220
  • Joined

  • Last visited

Everything posted by aquatsr

  1. So I have a table called books and I want to select all titles that start with 'a' or 'A' how do I do such a thing? Also how would I do that for titles starting with numbers (any number)?thx.
  2. Seems I'm a little late to the discussion... but I use Notepad++...
  3. I doubt it. I'm guessing you're going to have to adjust the absolute setting and tweak your site accordingly.
  4. My website uses the forum to keep track of users. I use the SMF from http://simplemachines.org and utilize their SSI features.
  5. Ahhh, thanks! Exactly what I was looking for! I also had to stripslash() the data.
  6. Your actual navigation text is centered but the div, or whatever it is, is aligned left... at least in Firefox 1.5
  7. I have some text in a TEXT attribute field in my database, and it's inputed like: ParagraphParagraphParagraph However when I get the $data from the field and do echo ("$data");I get: ParagraphParagraphParagraph How do I make sure there are the line breaks in the correct places?
  8. I see... damn, I personally hate javascript.
  9. Thanks, you were right-on. And the user-input is escaped elsewhere in the code.
  10. I see. Makes sense.Ahhh... just a sidenote but my marquee isn't validating as XHTML 1.0... are marquees not allowed?
  11. Like reportingsjr, the short answer is you can't. Short of, of course, creating an image and displaying it using html/css or having the user download it and place it in the correct folder.The best solution would be to use flash (as stated), but then you have to force the user to download flash player.Looks like you'll be doing a lot of forcing...
  12. I'm actually in the final stages of a site that is built around Google Ads, so I'll give you a quick breakdown of how (I believe) Google Adsense works.Suppose a friend of yours, Bob, runs a business selling Sulfuric Acid. Now, he spends almost all of his free time making this substance and has very little time to advertise. He is also on a tight budget. Anyway, he finds this service called Google Adwords, which upon receiving a little information from him (and money) agrees to place one type of ad that is called Cost per Click (CPC) and another type, Cost per Impression (CPI). So Bob goes off to make Sulfuric Acid, and Google goes off to place the ad.Along come people like you and me. We're web developers who want to make some cash. Maybe we're trying to pay our hosting costs. Maybe we want that Ferrari our neighbor bought. Whatever. The great thing about Google Adsense is you sign up - and it costs you nothing. You use it - it costs you nothing. You abandon it - it costs you a million bu--- uhh I mean it costs you nothing. Bottom line: it's free. So you sign up, place the ads (they have a fantastic tour, check it out at http://google.com/adsense) and sit back. You get paid in one of two ways. For CPC ads, you get paid a previously agreed upon amount (between Google and Bob, I assume) whenever someone clicks on Bob's (or Dave's, or Lisa's) ad. From what I've seen, it ranges from 6 cents to 26 cents (in my personal experience). The other kind of ad is CP(1000)I. For every 1000 times you display a Bob's ad, you get some cash. Now since my site is not mainstream yet, I haven't gotten 1000 impressions on any single ad, so I can't give you firsthand info. About payment: Once your financial identity is verified (Google's not dumb, fellas) Google will either send you a check every month of that month's profit, or transfer the funds electronically into your bank account. You can also opt to place a hold on your payments. Well, that's aquatsr's quick-and-dirty guide to Google Adsense.Did I mention it's free?One Caveat about Ads: I use Firefox's ad-block extension, so my page looks very funny when the extension is running (huge white gaps where the ads should be). So design wisely!
  13. Use Javascript? Sorry, I don't have any links for you, I rarely use javascript. It tends to fail on me.
  14. If you charge someone for downloading that code, yes, that's illegal. But say you're running a business that sells computers and you use say, PHP-Nuke to keep track of your users etc. Because you're selling a product, effectively the "content" and not the open-source code for PHP-Nuke, then you're in the all-clear. Just be sure your "computers" aren't illegal themselves!
  15. OK. I've been writing and rewriting this code over and over, but it just won't do what I want it to. Basically I have one page which works fine (1st block of code) which queries the database for all entries and has you choose one. <?php//Login stuff cut out, all works perfect to fetch resultswhile ($row = mysql_fetch_array($result)) {$id = $row['song_id'];$title = $row['title'];$artist = $row['artist'];$option_block .= "<option value =\"$id\">$title by $artist</option>";}$display_block = "<form method=\"POST\" action=\"modify_test.php\"><p><strong>Lyrics of </strong><select name=\"id\">$option_block</select> <input type=\"submit\" name=\"submit\" value=\"Select this Entry\"></p></form>";}?><p><center>Select a lyrics entry from the list below</center></p><?php echo "<center>$display_block</center><br />"; ?> However, once I get to the page, modify_test.php, none of the results display given this second block of code: <?php//Again login and connection info... is all correct.//I'm assuming my problem begins here.$sql = "SELECT title, artist, album, release_year, genre, language, date_added, added_by, english_lyrics, translation FROM songs WHERE song_id = \"$id\"";echo $id; /* No result from this test */$result = mysql_query($sql);if (!$result){die ("<center>Could not query the database: <br />". mysql_error()."</center>");}else {while ($row = mysql_fetch_array($result)) {$title = $row['title'];$artist = $row['artist'];$album = $row['album'];$year = $row['release_year'];$genre = $row['genre'];$language = $row['language'];$date = $row['date_added'];$user = $row['added_by'];$lyrics = $row['english_lyrics'];$translation = $row['translation'];}}}?><div id="content"><center>This record was originally added by <?php echo "$user";/* echo date("m/d/y/ G.i:s", $date);*/ ?>.<form action="update.php" method="POST">Song<br /><input type="text" name="title" size="50" value="<?php echo htmlspecialchars(stripslashes($title)); ?>" /><br /><br />Artist<br /><input type="text" name="artist" size="50" value="<?php echo htmlspecialchars(stripslashes($artist)); ?>" /><br /><br />Album Name<br /><input type="text" name="album" size="50" value="<?php echo htmlspecialchars(stripslashes($album)); ?>" /><br /><br />Release Year<br /><input type="text" name="releaseyear" size="50" value="<?php echo htmlspecialchars(stripslashes($year)); ?>" /><br /><br />Genre<br /><input type="text" name="genre" size="50" value="<?php echo htmlspecialchars(stripslashes($genre)); ?>" /><br /><br />Lyric Language<br /><input type="text" name="language" size="50" value="<?php echo htmlspecialchars(stripslashes($language)); ?>" /><br /><br />English Lyrics<br /><textarea name="englyrics" rows="6" cols="50" value="<?php echo htmlspecialchars(stripslashes($lyrics)); ?>"</textarea><br /><br /><?php if ($translation != "") {echo ("Translation<br /><textarea name=\"translation\" rows=\"6\" cols=\"50\" value=\"<?php echo htmlspecialchars(stripslashes($translation)); ?>\"</textarea><br /><br />"); } ?><input type="submit" name="submit" value="Modify Entry" /><br /></form></center></div><div id = "bottombar"><center><font color="red">Warning, warning! This page is not yet active!!</font></center></div> Can anyone tell me why almost all the POSTDATA isn't showing up? The only thing that shows up are a lot of empty fields (except for the language field, which reads "english"). I'd greatly appreciate a solution to this problem.
  16. Uhhh. I'm not sure what you mean. I'm using this: English Excerpt<br /><textarea name="engexcerpt" rows="6" cols="50" value="<?php echo htmlspecialchars(stripslashes($excerpt)); ?>"</textarea><br /><br />
  17. Hmmm I know what you want, but you'll have to be patient as I (and others) will need some time to come up with an adequate response. Have you looked into free content management systems?
  18. like everyone else has said: images need some work.
  19. Yes, you can use HTML as if it were an html page. However I like to use echo to show html... i.e.echo ("<center>This is shown using echo()</center>"); In order to show html w/o using echo() you need to close the php tag i.e. html stuff here<?php?>more html here
  20. I have a form that redisplays information when it isn't filled out correctly. Unfortunately in my <textarea> the information isn't redisplayed. Why would that be?
  21. Can't you just put a background into the page that your frame sources?
  22. Hmmm. So as I understand it, you have a part of your page that is static (i.e. the links) and you want to have the middleColumn change upon clicking a link. If that is so, you will want to switch in php files where say file1.php contains the data for about, file2.php is for home etc.Oh I might see what your frustration is. You're wondering what to put as your "About" URL. OK. First you must have a page, say, content.php that contains the material you want shown when you click "About" For your about URL put ?link=1. Then in your switch statement, change the page1.php under case 1 to about.php.Do likewise for your other links (changing each in the includes in the different cases in the switch statements and the corresponding URL in your list).If you're not getting it right away don't despair. It took me quite a while to understand this concept.
  23. I'm pretty good at writing css that validates, but I don't understand why validation itself is important...
×
×
  • Create New...