Jump to content

SharkBait

Members
  • Posts

    845
  • Joined

  • Last visited

    Never

Everything posted by SharkBait

  1. I started with two books: PHP for the World Wide Web: Visual QuickStart Guide: Visual QuickStart Guide - ISBN: 0321245652 Php And Mysql For Dynamic Web Sites: Visual Quickpro Guide - ISBN: 032133657 Both helped me learn the basics.  I then found phpfreaks (yea this place) looked over the tutorials, registered on the forums. I actually started out by Converting an excel application at work to an MS Access project, and then wanting to get back into web design and the more dynamic side of it, I converted the MS Access project into a in-house website application with PHP and MySQL.  Any questions I had about what I needed to do I just asked here. This place has been by far the most helpful out of all the resouces I have found on the net. But don't forget PHP.net.  <--- 2nd Best Friend next to PHPFreaks.com ;)
  2. Personally I think its easier to go through multiple pages of code rather than a HUGE single document of all the code. I look at my scripts and I fid it easier to go through 100-200lines as opposed to 500+ lines to find that missing curly brace. It looks alot neater too, or so I think.
  3. Hrm Is the other form a seperate page altogether? Does it do any of the processing of the previous form? If it is a seperate form and does not do any of the previous form's processing then you might have to pass the status of the checkbox via the URL and obtain it with $_GET['value']. To see if box is checked: [code=php:0] if (isset($_POST['checkbox1'])) { [/code] If it is not checked, then it's like it doesnt exist. Now in the next form, if you want to have a box already checked then its something similar to: [code] <?php // Get value from URL of the checkbox $checked = $_GET['checkbox1']; ?> <!-- HTML HERE--> <input type="checkbox" name="checkbox2" <?php if (isset($checked)) echo "checked=\"checked\"";?> /> Checkbox 2 [/code]
  4. I did what bbsidian suggested and it worked.  I was using double quotes and they are now working properly thanks to [code=php:0]htmlentities($blah);[/code]
  5. Sorry Obsidian, didnt see your reply. I will use that. I knew there was a function for the entities but couldn't remember it.
  6. I get this: [code] <td><input type="text" size="20" name="title" value="\"Crikey\" it's a stingray!" /> Title</td> [/code] And it displays only a \ in the text box.
  7. I've tried that and in the input box it only displayed a / with no text. Looking at the source it looks like [code]<td><input type="text" size="20" name="title" value="/"Crikey/" it's a stingray!" /> Title</td>[/code]
  8. Hi, I'm having troubles with inserting values into an HTML form. This is the value in the databae:  "Crikey", look at the size of that thing! To be put into: [code]<input type="text" name="title" value="<?php echo $valueFromDB;">" />[/code] But because Crikey is enclosed with " " it breaks the HTML.  How do I fix this? Do I just replace all " with ' ? Thanks
  9. acdx: Ah that works nicely, though it was missing [code=php:0] $image = imagecreatefromjpeg($imagefile); [/code] AndyB: I was using the one you mentioned but it somehow, didnt resize the image properly.  But I was able to use it and take bits from what acdx posted and now I have a working thumbnail generator. Thanks :) Now I gota figure out do I create some sorta inline image uploader, or do I just do it seperately and have my article editor select from the database of images?  Oh well thats another topic I suppose. Thanks again.
  10. Thoughs are some decent tutorials, thanks Is it possible to create the thumbail on the fly?  What I mean is when a page is loaded and images are to be shown that it shows a tempoary thumbnail instead of the full image?  Or is it best to create the thumbnail upon uploading of the image and just store it?
  11. Hi,   I am looking at learning to play with the GD by incorporating it into my little site. I want to be able to upload images and have the GD create a thumbnail and store it in a thumbnail directory and have the original image stored in another directory.  These entries will also be put into a database. What should I be looking into?  I can't remember that URL for the GD site, but I am sure someone else can. When I display an image to someone on my site, can I have the GD put a border around the image as well? Or is it imagemagik that I should be looking into?
  12. If the user is logged in, check to make sure that the user who is currently logged in matches that of the profile. IE [code] <?php $USERNAME = "SharkBait"; $USER = "SharkBait";  // Retrieved from a database if($USERNAME == $USER) {   // Allow user to edit profile } else {   // User is not allowed to edit profile   echo "<p>You are unauthorized to do that action.</p>\n"; } ?> [/code]
  13. What is the difference between: [code=php:0] str_replace("'", "\'", $mystring); [/code] and [code=php:0] mysql_real_escape_string($mystring); [/code] ??
  14. Are you using hotmail?  Hotmail Live?  If so I know I had to add the domain the mail was coming from into the trusted recipients list.
  15. How is it not working? Is it giving you an error? If the webserver has successfuly sent the mail, and you're sending it to Hotmail/Yahoo/Gmail there might be issues with either the content of the email and being caught as spam. Or the email is being redirected and most anti-spam software sees Relaying as a security issue.
  16. You mean in phpMyAdmin where the entire row gets changed a differenet colour? If that is what you mean then its just javascript that changed the background color attribute of the <tr> tag to display a differnet colour on mouseover and mouseout
  17. Something that has been asked of me and I have not personally done yet is being able to make a general search of a website.  Making it so that it seaches the website the user is on I mean. Are there any good tutorials out there for doing this?  Is the general idea for something like this is have PHP go through the actual files in the web directory locating the search phrase and if it finds it display a link to that page? Seems a bit tricky to have php run through all the directories on a website.  I would have to make it limit to particular directories. Wouldn't want admin pages or mysql connetion scripts showing up ;)
  18. My pagnation works great.. except if I use a search query and it is more than 1 page big. It displayed the pages in the pagenation part right but if you click on one of the numbers it forgets the query it was looking at and just displays the data as if the query was never done. What is the best way for having it 'remember' the query?  The query is a simple form text box that is $_POST'd If needed I can post the lengthly pagnation code I have.
  19. Hopefully this works, the idea is there anyway ;) [code] <?php $i = 1;  // Counter foreach ($_FILES["pictures"]["error"] as $key => $error) {   list($artistname, $extension) = explode(".", $_FILES['name'][$key]);  // seperate name from extension   if ($error == UPLOAD_ERR_OK) {       $tmp_name = $_FILES["pictures"]["tmp_name"][$key];       $name = $_FILES["pictures"]["name"][$key];       move_uploaded_file($tmp_name, "images/{$artistname}{$i}.{$extension}");   }   $i++; } ?> [/code] Though this wouldnt take into account of the artist has uploaded in past.  That would involve seeing how many files they already have uploaded and starting $i at that point and then continuing the increment.
  20. Crayon Violent: Aye I noticed that it's not needing to be bumped for a while. I just thought it would _look_ better if there weren't the bump replies. That's all.  We can close the thread now its been answered. Thanks
  21. I used to do banner rotation, not the flash/animated gif but via rand() and loading differenet images when the page was refreshed.
  22. Another way to do it would be readdir() Here is the example from php.net [code] <?php if ($handle = opendir('.')) {   while (false !== ($file = readdir($handle))) {       // Strip out .. and .       if ($file != "." && $file != "..") {           echo "$file\n";       }   }   closedir($handle); } ?> [/code]
  23. What is $result set to? Should be something similar to [code] <?php $result = mysql_query($Whatevermyqueryis) or die("MySQL Error: <br />{$Whatevermyqueryis}<br />". mysql_error()); ?> [/code] Not sure if your current code has it but make sure there one Curly Brace {  after your while()
  24. hehe I was just curious. I just asked because I added something to my post, and CrayonViolet merged the two posts together into one. Just thought it would be nicer than having a mod do it that's all. :) Btw, still loving SMF :D
×
×
  • 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.