Jump to content

justcrapx

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

justcrapx's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ah thank you bot, i figured out the issue now. TOPIC SOLVED =)
  2. I have an include folder for my scripts inside the root dir, all scripts are also included in the root. When i moved some of my scripts to a spesific folder the include function seeks the file inside that spesific directory, i want to target the original inc folder. this is the include line include 'inc/functions.php'; i have tried this but didnt work include '../inc/functions.php';
  3. can anyone tell me why does this: [code]<?php $arr = array(); $a = 0; while($a < 5) { $arr['$a'] = 10 + $a; $a++; echo $arr['$a'] . " - "; } echo "<br/>" . $arr[3]; ?>[/code] output this: 10 - 11 - 12 - 13 - 14 - it does not print $arr[3], is there a syntax error?
  4. Im running apache to learn php scripts and theres an error about the image files. Once that error occured, i had to format my computer to solve it, but now it happens again. When i request a large image file from the server, it does not seem to load completely. But small images load fine. Just check it by the links. The first one is for a large image, and the second for the small. http://zpat.sytes.net/samplea.jpg http://zpat.sytes.net/sampleb.jpg Hope anyone can figure it out, need to fix it soon.
  5. How can i crop an image using gd? I want to cut off exceeding width or height and to make the image square. A simple example for only jpg would make it.
  6. Can someone gimme the idea to check if any string elements of an array are longer than "x" characters. In other words, pretend that theres an array which we dont know how many elements it has. And this array only keeps strings. All i want is a code that returns false if theres any long string than 20.
  7. Does anyone know how to setup GD library under windows xp and apache 2? Is it just to dump dll file into the extension dir? So where to get the dll?
  8. The string is always a message just like each one in this forum topic. So i dont have the chance to know the scheme, domain name or path everytime. What i needed was some code to fetch any link inside the string between anchor tags and to  target the link itself. Finally i managed to find a way. That works for any probable url for the http:// or www scheme. [code] <?php $mssage = preg_replace('=([^\s]*)(www\.)=', ' http://www.', $mssage); $mssage = preg_replace('=([^\s]*)(\w://[www\.]*)([^\s]*)=', '<a href="\\1\\2\\3\\4" target=_blank>\\1\\2\\3\\4</a>', $mssage); return $mssage; ?> [/code]
  9. [code]<?php $mssage = "this is an url : http://www.blank.com"; $a=preg_match("/\bhttp:\/\/([A-Za-z0-9._-]+) \b.*/i",$mssage,$b); $url = "http://$b[1]"; echo $url; ?>[/code] Output Notice: Undefined index: 1 in C:\Webserver\Apache2\htdocs\parse_url.php on line 9 http://
  10. Guess it will be neccessary and a hard thing to expand that code, cuz links are not always that simple. Just like the following. http://www.phpfreaks.com/forums/index.php?action=post;topic=116205.0;num_replies=8
  11. Ok thanks. Hop i can figure it out.
×
×
  • 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.