Jump to content

ident

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ident's Achievements

Member

Member (2/5)

0

Reputation

  1. Just wanting to start learning php. I have always enjoyed wrox books, can any one suggest one from here for a beginner.? http://www.wrox.com/WileyCDA/Section/PHP-MySQL.id-131383.html or have any other suggestions
  2. I use dreamweaver. any better suggestions?
  3. wish i could make sites like that
  4. It's only for me and a few friends. Il have a look at that one you mentioned. thanks and happy new year
  5. any one ever attempted this? something like http://www.zend2.com/ i assume doing this would be quite hard???
  6. is there something i can read to help my impliment this? im extreamly new to php, but willing to learn
  7. u will have to forgive me i didnt build the site. it's mine but a mate did. the handle script is <?php require_once('../inc/config.inc.php'); function rand_str($length = 14, $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890') { // Length of character list $chars_length = (strlen($chars) - 1); // Start our string $string = $chars{rand(0, $chars_length)}; // Generate random string for ($i = 1; $i < $length; $i = strlen($string)) { // Grab a random character from our list $r = $chars{rand(0, $chars_length)}; // Make sure the same two characters don't appear next to each other if ($r != $string{$i - 1}) $string .= $r; } // Return the string return $string; } if( (!$_FILES) || ( !is_uploaded_file($_FILES['upfile']['tmp_name']) ) ) { # nothing given to upload header('Location: Upload.htm'); } require_once('../inc/mysql.inc.php'); # check the given file extension is valid $allowed_exts = array('jpeg', 'jpg', 'gif', 'tiff', 'png', 'tif'); $infile_bits = explode('.', $_FILES['upfile']['name']); $infile_ext = strtolower( $infile_bits[count($infile_bits)-1] ); # quit if an invalid extension is given if( !in_array($infile_ext, $allowed_exts) ) { include('header.php'); echo '<div style="text-align: center;"><img src="homer.gif" width="290" height="267" /></center>'; echo '<div style="text-align: center;">'.htmlentities($infile_ext, ENT_QUOTES).' is not supported</div>'; die; } # create a random filename that isn't yet taken in the database $nametries = 0; $nameok = 0; while($nametries < 4) { $filename = rand_str(); $check_query = 'SELECT `id` FROM `images` WHERE `storedname` = \''.$filename.'.'.$infile_ext.'\''; $check_result = mysql_query($check_query); @$check_row = mysql_fetch_object($check_result); if(!$check_row->id) { # this filename isn't taken yet $nameok = 1; break; } $nametries++; } if(!$nameok) { print 'error: failed to find usable filename (this is probably a bug)'; die; } # copy the file to the storage folder if( !move_uploaded_file($_FILES['upfile']['tmp_name'], $config['uploadpath'].$filename.'.'.$infile_ext) ) { print 'error: failed to move the uploaded file'; die; } # input the new file in the database $newup_query = 'INSERT INTO `images` (`upname`, `storedname`, `fileext`, `uploaded`) VALUES (\''.addslashes($_FILES['upfile']['name']).'\', \''.$filename.'\', \''.$infile_ext.'\', NOW())'; mysql_query($newup_query); header('Location: viewpic.php?file='.$filename); ?> i dont know what htaccess file is
  8. just found 2 instances of this on my website that had been uploaded by the image upload. My sites been coded to stop anything bad happening like this and nothing did. what could it of done?
  9. Basically my site is having a few bugs with how it displays IE. It works fine in FF. while i am sorting this i added a redirction page to alert the user. <?php function ae_detect_ie() { if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) return true; else return false; } ?> <?php if (ae_detect_ie()) { ?> echo "<script language='javascript'> window.location = "http://www.url.com/Ie.php" </script>"; <?php } ?> Obviously each time they hit index.php it displays this. How can i add a varible or something so it only redirects them once. than ks
  10. oni-kun, lol i just realised that a second after i posted, Opps, fail? marcus yeh i know that ta, wrong forum /hangs head in shame cheers guys
  11. Alot of people on a forum i go onto try to do little tricks like [url=http://img405.imageshack.us/img405/6295/BADPICTURE.jpg]www.google.co.uk[/url] I know a little php. But not really sure on where to start. I would like it to be displayed as when changing the view of the web page..... www.google.co.uk Hidden Link http://img405.imageshack.us/img405/6295/BADPICTURE.jpg is this even possible? page source looks like <a href="http://img405.imageshack.us/img405/6295/BADPICTURE.jpg" class="postlink" target="_blank">www.google.co.uk</a></div> any help would be great
  12. ah dodgy varible case had it as IP thanks
  13. Hi. iv made it quite clear as picture shows. i have got this <?php // entered IP address $enteredIpaddress = $_POST['norobots']; // Actual IP address $usersIpaddress = $_SERVER['REMOTE_ADDR']; // GO COMPARE!!!!11111 if ($enteredIpaddress != $usersIPaddress) { // if wrong IP entered redirect to google or what ever! header('location: http://www.google.co.uk'); } else { // DO all this if the IP's match! //add the header include('header.php'); //define the receiver of the email $to = $_POST["to"]; //define the subject of the email $subject = htmlentities($_POST["subject"], ENT_QUOTES); //define the message to be sent. Each line should be separated with \n // http://www.simplecoders.com/showpic.php?f=IR6eC3zS2w41wA.jpg $url_bits = parse_url($_POST['rawlink']); if( !preg_match('/f=[a-z-A-Z0-9]+\.[a-z]{1,3}/', $url_bits['query']) ) { echo "bad link"; die; } $_POST['msg'] = str_replace('[iMAGE]', $_POST['rawlink'], $_POST['msg']); $message = htmlentities($_POST["msg"], ENT_QUOTES) . "\n\n\n\n******************************************\n\nFree image hosting at www.simplecoders.com\n\nThe Simple Coders Team "; $headers = "From: SimpleCoders\r\nReply-To: support@simplecoders"; //send the email $mail_sent = @mail( $to, $subject, $message, $headers ); echo $mail_sent ? "<br /><center>Mail sent" : "Mail failed"; echo "<br /><a href=\"Upload.php\">Click here to go back to the previous page</a></center>"; } ?> but it always goes to google.
×
×
  • 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.