Jump to content

dingles

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dingles's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. What is a .gdf file and what program do I use to open or create one? I know it contains font information but I can't seem to find out what I can use to view it. I ask because I found it in a piece of code I was picking through: [code]<?php header("Content-type: image/png"); $im = imagecreatetruecolor(50, 20); $black = imagecolorallocate($im, 0, 0, 0); $white = imagecolorallocate($im, 255, 255, 255); imagefilledrectangle($im, 0, 0, 49, 19, $white); $font = imageloadfont("04b.gdf"); imagestring($im, $font, 0, 0, "Hello", $black); imagepng($im); ?> [/code]
  2. My plan was to store the variables in a database. But I wanted to see if I could do what I wanted to do here first. I think you answered my question. foreach looks like it might be what I was looking for. I'll give it a try, thanks!
  3. I am able to scrape a single page for html data. I'm looking to be able to scrape multiple pages in the same script and store them as variables. For example. The link to page one would be [a href=\"http://somepage.jsp?pid=10\" target=\"_blank\"]http://somepage.jsp?pid=10[/a] and the link to the second page would be [a href=\"http://somepage.jsp?pid=11\" target=\"_blank\"]http://somepage.jsp?pid=11[/a] Here is the code that works with scraping data from the first page and saving information to variables: [code]<?php // the url I need to fetch for the user information $url = "http://somepage.jsp?pid="; //Append the users pid onto the URL and read the page into the $page as an array $page = file($url . $_POST['10']); if (!is_array($page)) {     echo "No Array found";     exit; } //Put the page in the $page variable $page = trim(implode("\n", $page)); //Some variables to store things $variable1 = ""; $variable2 = ""; $variable3 = ""; $variable4 = ""; //The pattern to scrape $pattern = "/<td align=\"right\">(.*)<\/td>\n/i"; if (preg_match_all($pattern, $page, $out, PREG_PATTERN_ORDER)) {     $variable1 = $out[1][0];     $variable2 = $out[1][3];     $variable3 = $out[1][4];     $variable4 = $out[1][5]; } ?> [/code] Is it simple to add something so I can store info for PID=11 or should I run 2 seperate scripts?
×
×
  • 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.