PHP - Preg_match() Unknown Modifier
Hi there,
I am NOT a PHP coder, but I have a site that is written in PHP and I am getting an error that keeps filling up my site cache and I just cannot figure it out - I know it has something to do with my images on the site, but none of them are out of the ordinary (GIFs and JPEGs, the only character apart from letters or numbers that i have used is the "_" and there are no spaces). I have looked around at the error I am getting - but I will be honest in that I dont really understand what the problem is or how to resolve it. Here is the error I get: PHP Warning: preg_match() [<a href='function.preg-match'>function.preg-match</a>]: Unknown modifier 'C' in /home/smcclean/public_html/includes/modules/additional_images.php on line 48 This relates to the following line of code: if(preg_match("/" . $products_image_base . "/i", $file) == 1) { I would really appreciate a steer as to how I could resolve this. Many thanks Similar TutorialsI have this function I use to simplify things. function search_string( $needle, $haystack ) { if ( preg_match_all( "/$needle/im", $haystack ) || strpos( $haystack, $needle ) ) { return TRUE; } return FALSE; } I keep getting this error in my PHP logs, and it comes in a sequence: [07-Nov-2020 05:34:14 America/Los_Angeles] PHP Warning: preg_match_all(): Unknown modifier 'G' in /home/baser-b/public_html/include/functions.php on line 791 [07-Nov-2020 05:34:14 America/Los_Angeles] PHP Warning: preg_match_all(): Unknown modifier 'g' in /home/baser-b/public_html/include/functions.php on line 791 Meaning, it will come with one with the small g, then three with the big G, then one with the small g, then five with the big G, and so on.... My question is, how can I stop getting this error. It won't show me the functions being called to arrive at this answer, as this is likely an error generated by another function calling this one. I was wondering if anyone knew what to change in the search_string function to stop getting this error, why this error is happening, or why the strange repetitive sequence. Is it someone trying to do a hack? The only variable that would be changeable by a visitor would be the $needle variable, so what could they type that has something to do with 'g' to get this? Anyway, thanks. Hey, So what im trying to do is put my database variables into a session array. So this is what im trying to accomplish... $_SESSION['Name_of_Row'] = $value This is the script I wrote: Code: [Select] Function setupSession(){ session_start(); $query = "SELECT * FROM users WHERE u_id ='{$this->u_id}'"; $result = mysql_query($query); $row = mysql_fetch_array($result); foreach($row as $key => $value){ if(!empty($value)){ $_SESSION[$key] = $value; } } } When that runs I get the following warning. Can anyone tell me what this means and how to fix it? Error: Notice: Unknown: Skipping numeric key 0 in Unknown on line 0 Only thing I really miss from PHP is "internal" access modifier. Before I was making libraries and extensions in C# (like game frameworks, Tiled implementations, GUI loaders). Now, when I am working on my own PHP framework, I really miss internal, I was using it a lot in C#. Is internal planned to be added in PHP 7 or is it already in PHP 5.6 or it will never be added?
I am using a regex with /iumsU modifiers. On some servers this crashes PHP and I need to turn UTF8 off thus the modifier becoming /imsU I am wondering how can I detect the requirements for /u to work normally so I can dynamically adjust my regex? Cheers Dear all, I am new to the forums, with a hope that somebody can point me in the right direction. I am coding a new photo website, and am doing it with PHP to maximize my flexibility. In essence I want to have a set of gallery folder on the server, and the site reads off these folders and automatically generates the required galleries. My PHP code is below, along with a detail of the exact problem: <?php $main = "Collections/"; # Location of galleries $big = "Large/"; # Location of big versions (subdir within each gallery) $i = 0; #Gallery Iterator #Searching for galleries & Checking only for directories (save them im $galleries array) $tempgalleries = scandir($main); foreach ($tempgalleries as $gallery_iterate) { if (!is_dir($gallery_iterate)) { $galleries[]=$gallery_iterate; } } #Iterating galleries. Collecting each gallery's images (saving in $GalleryImages.$i). This creates an image array for each $galleries[$i] for($i=0; $i<=sizeof($galleries)-1; $i++) { #Making the title nice (from the the directory names) $GalleryTitles[$i] = str_replace('_',' ', $galleries[$i]);; $temp_gallery = opendir($main.$galleries[$i]); #Checking for Images and storing in array if valid while (false !== ($image = readdir($temp_gallery))) { if ($image != "." && $image != ".." && $image != rtrim($big,"/") && strstr($image,'.jpg')) { ${$GalleryImages_.$i}[] = $image; } } #Sorting the images numerically natsort(${$GalleryImages_.$i}); closedir($temp_gallery); } #Better location for the buttons!! #Printing the galleries and all the html required for naming, separation, etc.. This is also an iteration for($i=0; $i<=sizeof($galleries)-1; $i++) { echo('<div class="galleries_hidden" id="gallery_'.$i.'"><hr><br><div class="Gallery_Title"><b><i><big>'.$GalleryTitles[$i].'</big></i></b></div><br>'); $folder=$galleries[$i]; foreach(${$GalleryImages_.$i} as $thumb_image) { echo '<a href="'.$main . $folder .'/'. $big . 'large_'. $thumb_image . '" rel="lightbox['.$folder.']" title="'.$folder.'"><img src="' . $main . $folder .'/'. $thumb_image. '" alt="'.$folder.'" class="Gallery_Image" /></a>'; } echo('</div>'); } #Making the buttons to cycle the galleries for($i=0; $i<sizeof($galleries); $i++) { echo('<input type="button" id="gallery_'.$i.'" value="Show '.$GalleryTitles[$i].'" onclick="showgallery(');echo("'gallery_".$i."');");echo('" /><br><br>'); } ?> I have managed to make each aspect work, exept one. The last portion, as commented: #Making the buttons to cycle the galleries for($i=0; $i<sizeof($galleries); $i++) { echo('<input type="button" id="gallery_'.$i.'" value="Show '.$GalleryTitles[$i].'" onclick="showgallery(');echo("'gallery_".$i."');");echo('" /><br><br>'); } This piece of code generates buttons which shows one gallery, and hides the rest. This is done by changing the classes of the divs from "galleries_visible" to "galleries_hidden", as applicable. This is done using a javascript declared in the header as follows: Code: [Select] <script type="text/javascript"> function showgallery(id) { var divall = document.getElementsByTagName("div"); var i=0; for (i=0;i<divall.length;i++) { if(divall[i].className == "galleries_visible") { divall[i].className = "galleries_hidden"; } var showdiv = document.getElementById(id); showdiv.className = "galleries_visible"; return false; } </script> When I have the button-generating php code below the gallery-generating php code, then the javascript seems to work, by showing and hiding respective galleries. These galleries and their litebox viewer all work normally. However, when putting the button-creator php above the gallery-generator php, then the buttons appear as normal, and the javascript runs, but it cannot find the div with the id it searches for: Code: [Select] var showdiv = document.getElementById(id); showdiv.className = "galleries_visible"; I am confused. The PHP code makes several arrays which stores all the file and folder information, and these arrays are read by the button-generator irrespective of its position (I know this because the buttons are generated based on the content of non-empty arrays). Why can't the javascript change the gallery-containing divs when they are below the button-containing div? Any help is greatly appreciated, I just cant seem to find whats wrong! Kind regards, Frederik Hey im kind of new to PHP me and my mate was working on a script and we can not seem to get this working: Its connected through mysql. And it shows Quote Notice: Undefined index: username in C:\xampp\htdocs\stick_arena.php on line 21 Notice: Undefined index: userpass in C:\xampp\htdocs\stick_arena.php on line 22 Notice: Undefined index: action in C:\xampp\htdocs\stick_arena.php on line 23 Notice: Undefined index: usercol in C:\xampp\htdocs\stick_arena.php on line 24 Notice: Undefined index: stats in C:\xampp\htdocs\stick_arena.php on line 25 Here are the lines Quote // declare variables $username = sanitize($_POST['username']); $password = sanitize(md5($_POST['userpass'])); $action = sanitize($_POST['action']); $usercol = sanitize($_POST['usercol']); $stats = sanitize($_POST['stats']); Here is the full script for that page: Click here please help as soon as possible. I Am getting along with php better than I was previously. But this 68 year old brain still refuses to learn very fast! Here is the error I'm receiving when I'm trying to open the db: Parse error: syntax error, unexpected T_VARIABLE in /home/taft65/public_html/memProtest.php on line 197 <?php error_reporting(E_ERROR | E_PARSE | E_CORE_ERROR); $host = "localhost"; $dbname="database;" Failing ------>$username = "user"; $password="drDedf#hj"; I understand you do not need to declare varibles in PHP, Correct? I checked the db to ensure that I'm calling the correct value. NuSpherePhpEd to validate the code. I also check it with DSV PHP Editor. Both come up with the same error. I'm also using MyPhpAdmin to create the database and tables. I know also to place this calling info in another folder and include it by calling it with a php include statement. I just have it within the code to quickly test it. Thank you for any assistance. Bob... im using 000webhost as a test site and when i run this code it redirects me to there err page but with no error message. the sql query works fine in phpmyadmin and i added the rest of the code to try the php side. i "think" the problem is the echo $rows"value's" as im unsure of what the $vars should be <?php include("config.php"); // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql = "SELECT make, COUNT(*) AS total, SUM(IF(comments = \'pass\', 1, 0)) AS withComments FROM dsgi_serval GROUP BY make ORDER BY COUNT(*) DESC"; $result=mysql_query($sql); echo "$sql"; echo "$result"; ?> <table><tr> <td colspan="4"><strong>List data from mysql </strong> </td> </tr> <tr> <td align="center"><strong>make</strong></td> <td align="center"><strong>Total</strong></td> <td align="center"><strong>Validated</strong></td> </tr> <?php while($rows=mysql_fetch_array($result)){ ?> <tr> <td><?php echo $rows['make']; ?></td> <td><?php echo $rows['total']; ?></td> <td><?php echo $rows['withcomments']; ?></td> </tr> <?php } ?> </table> <?php mysql_close(); ?> Hey, I've got a query in which a variable is interpreted as a column and I don't why this is caused. $upgrade_time_sql = "SELECT * FROM todo_upgrades WHERE profile_id = ".$profile_id." AND level = ".$profile_data['level2_'.$show.'']." AND type = ".$show.""; $upgrade_time_res = mysql_query($upgrade_time_sql) or die (mysql_error()); $show is filled with the content "storage" The mysql_error is "Unknown column 'storage' in 'where clause'" Thanks for helping. Hello! I have a strange error on my PHP script and i dont how to fix it. If someone can help me, please help me then! Here is my error: Code: [Select] logout(); } else { $iq = mysql_query("SELECT * FROM users WHERE username='{$signin_username}' AND password='{$signin_password}' AND suspended='0' LIMIT 1;"); $ir = mysql_fetch_array($iq); $_SESSION['me'] = $ir; } } } } else { die("The configuration did not recieve appropriate variables to accept your request."); } if ($set['next_clearup'] < time ()) { $next_clearup = time () + 60 * 60 * 24; mysql_query ('' . 'UPDATE settings SET set_value=\'' . $next_clearup . '\' WHERE set_name=\'next_clearup\' LIMIT 1;'); mysql_query ('UPDATE users SET ads_clicked=\'\' WHERE ads_clicked!=\'\''); } } ?> Warning: include(THDIRindex.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\Upload\index.php on line 16 Warning: include() [function.include]: Failed opening 'THDIRindex.php' for inclusion (include_path='.;\xampp\php\PEAR') in C:\xampp\htdocs\Upload\index.php on line 16 And here is the PHP file the error is in: Code: [Select] <?php session_start(); include_once('lib/lib.php'); include_once('lib/configuration.php'); $ddir = THDIR.$do->get_file_url(); include($ddir); if(file_exists(HEADER)) { include_once(HEADER); } if($contents) { print $contents; } if(file_exists(FOOTER)) { include_once(FOOTER); } ?> Help ASAP if you can! So I've been working on this site for a few days now, and it's coming along slow but well. I'm trying to learn as much as possible about the coding I'm doing because it's a bit outside my skill range, so I'm taking my time. I'm using a switch statement to dictate navigation, and netsted switches inside as well. Everything was going great until I started continuing to add code to each case of the switch, then all of a sudden 2 of the cases show up blank, but nothing else is affected. I spend an hr last night and this morning, looking and redoing, to get the same result. Can someone take a look at this and advise please? <?php switch ($_GET['page']) { case 'news': switch ($_GET['id']) { case $_GET['id']: $id = $_GET['id']; $link = mysql_connect ($host, $user, $pass); mysql_select_db ($db, $link); $query = "SELECT * from news WHERE id = '$id'"; $result = mysql_db_query ($db, $query, $link); while ($row = mysql_fetch_array($result)){ echo ("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td colspan=\"2\" class=\"Main-Header\"><a href=\"index.php?page=news&id=".$row['id'] . "\">".$row['title'] . "</a></td> </tr> <tr> <td colspan=\"2\" class=\"Main-PostInfo\">Posted By: $row[author] on $row[date]</td> </tr> <tr> <td colspan=\"2\" class=\"Side-Content\">$row[content]</td> </tr> </table><br /> "); } break; default: $link = mysql_connect ($host, $user, $pass); mysql_select_db ($db, $link); $query = "SELECT * from news'"; $result = mysql_db_query ($db, $query, $link); while ($row = mysql_fetch_array($result)){ echo ("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td colspan=\"2\" class=\"Main-Header\"><a href=\"index.php?page=news&id=".$row['id'] . "\">".$row['title'] . "</a></td> </tr> <tr> <td colspan=\"2\" class=\"Main-PostInfo\">Posted By: $row[author] on $row[date]</td> </tr> <tr> <td colspan=\"2\" class=\"Side-Content\">$row[content]</td> </tr> </table><br /> "); } break; } break; case 'about'; $link = mysql_connect ($host, $user, $pass); mysql_select_db ($db, $link); $query = "SELECT * from aboutvow"; $result = mysql_db_query ($db, $query, $link); while ($row = mysql_fetch_array($result)){ echo ("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td class=\"Main-Header\">$row[title]</td> </tr> <tr> <td class=\"Side-Content\">$row[content]</td> </tr> </table><br /> "); } break; case 'roster': switch ($_GET['id']) { case $_GET['id']: $id = $_GET['id']; $link = mysql_connect ($host, $user, $pass); mysql_select_db ($db, $link); $query = "SELECT * from roster WHERE id = '$id'"; $result = mysql_db_query ($db, $query, $link); while ($row = mysql_fetch_array($result)){ echo ("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td width=\"30\" colspan=\"2\" class=\"Main-Header\">-VoW- $row[gamename]</td> </tr> <tr> <td colspan=\"2\" class=\"Main-PostInfo\">SECTION 1: PERSONAL INFORMATION</td> </tr> <tr> <td class=\"Side-Content-Left\">Name</td> <td class=\"Side-Content-Right\">$row[firstname] $row[lastname]</td> </tr> <tr> <td class=\"Side-Content-Left\">Location</td> <td class=\"Side-Content-Right\">$row[location]</td> </tr> <tr> <td class=\"Side-Content-Left\">Age</td> <td class=\"Side-Content-Right\">"); date_default_timezone_set('America/New_York'); function calculateAge($dob){ return floor((time() - strtotime($dob))/31556926); } $age = calculateAge("$row[dob]"); echo ("$age</td> </tr> <tr> <td class=\"Side-Content-Left\">Connection</td> <td class=\"Side-Content-Right\">$row[connection]</td> </tr> <tr> <td colspan=\"2\" class=\"Main-PostInfo\">SECTION 2: CONTACT INFORMATION</td> </tr> <tr> <td class=\"Side-Content-Left\">Email</td> <td class=\"Side-Content-Right\">$row[email]</td> </tr> <tr> <td class=\"Side-Content-Left\">Steam</td> <td class=\"Side-Content-Right\">$row[steamfriends] ($row[steamemail])</td> </tr> <tr> <td class=\"Side-Content-Left\">Xfire</td> <td class=\"Side-Content-Right\">$row[xfire]</td> </tr> <tr> <td colspan=\"2\" class=\"Main-PostInfo\">SECTION 3: DAY OF DEFEAT INFORMATION</td> </tr> <tr> <td class=\"Side-Content-Left\">DoD Experience</td> <td class=\"Side-Content-Right\">"); date_default_timezone_set('America/New_York'); function calculateExp($exp){ return floor((time() - strtotime($exp))/31556926 + 8); } $exp = calculateExp("$row[dodexp]"); echo ("$exp Years</td> </tr> <tr> <td class=\"Side-Content-Left\">Class</td> <td class=\"Side-Content-Right\">$row[class]</td> </tr> <tr> <td class=\"Side-Content-Left\">SteamID</td> <td class=\"Side-Content-Right\">$row[steamid]</td> </tr> <tr> <td colspan=\"2\" class=\"Main-PostInfo\">SECTION 4: MATCH INFORMATION</td> </tr> <tr> <td colspan=\"2\" class=\"Main-Content\">-VoW- $row[gamename] has no match history</td> </tr> </table><br /> "); } break; default: $link = mysql_connect ($host, $user, $pass); mysql_select_db ($db, $link); $query = "SELECT * from roster"; $result = mysql_db_query ($db, $query, $link); while ($row = mysql_fetch_array($result)){ echo ("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td colspan=\"5\" class=\"Main-Header\">Roster</td> </tr> <tr> <td width=\"101\" class=\"Main-Roster-Left\">Name</td> <td width=\"124\" class=\"Main-Roster\">Status</td> <td width=\"241\" class=\"Main-Roster\">SteamID</td> <td width=\"175\" class=\"Main-Roster\">Class</td> <td width=\"452\" class=\"Main-Roster\">Recruitment Date</td> </tr> <tr> <td class=\"Main-Roster-Content-Left\"><a href=\"index.php?page=roster&id=".$row['id'] . "\">".$row['gamename'] . "</a></td> <td class=\"Main-Content-Roster\">$row[status]</td> <td class=\"Main-Content-Roster\">$row[steamid]</td> <td class=\"Main-Content-Roster\">$row[class]</td> <td class=\"Main-Content-Roster\">$row[admin_recdate]</td> </tr> </table>"); } break; } break; case 'servers': switch ($_GET['id']) { case 1: echo "ID is 1"; break; case 2: echo 'ID is 2'; break; default: echo 'No ID - display main servers'; break; } break; case 'forum'; echo ("FORUM HERE"); break; default: $link = mysql_connect ($host, $user, $pass); mysql_select_db ($db, $link); $query = "SELECT * from news ORDER BY date DESC LIMIT 5"; $result = mysql_db_query ($db, $query, $link); while ($row = mysql_fetch_array($result)){ echo ("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td colspan=\"2\" class=\"Main-Header\"><a href=\"index.php?page=news&id=".$row['id'] . "\">".$row['title'] . "</a></td> </tr> <tr> <td colspan=\"2\" class=\"Main-PostInfo\">Posted By: $row[author] on $row[date]</td> </tr> <tr> <td colspan=\"2\" class=\"Side-Content\">$row[content]</td> </tr> </table><br /> "); } break; case 'recruitment': switch ($_GET['action']) { case 'apply': echo "APPLICATION HERE"; break; case 'submit': echo 'SUBMIT APPLICATION'; break; case 'status': echo 'APPLICATION STATUS'; break; default: echo 'No ACTION - display main recruitment'; break; } break; } ?> The problem I am having is getting the default news case and default roster case to print. Everything else shows up properly. Sorry for the messy code, I"m working on it! Hey I have a script that builds an array but for some reason there is a loose integer in the variable which is confusing me and i think its the cause of my syntax errors in javascript. But i got no idea where it is coming from =/ Here is the function i use: Code: [Select] <?php function img($id) { $img = array(); $img['tiles'] = $this->db->getAll("SELECT DISTINCT t.id, CONCAT('data/tiles/',filename) AS f FROM `map_tiles` AS mt INNER JOIN `tiles` AS t ON (mt.tile=t.id) WHERE mt.map_id={$this->db->qstr($id)}"); echo print_r($img); die; //exit(json_encode($img)); // turned off for testing ?> The echo returns this: Code: [Select] Array ( [tiles] => Array ( [0] => Array ( [id] => 10 [f] => data/tiles/floor.png ) ) ) 1 <----- why does this appear? And could this cause a syntax error if sent back for JS processing? As you can see there is 1 showing at the end but i don't see why =/ Any ideas if thats suppose to happen ? I'm using the php mail function and sending to Gmail accounts it shows "Unknown Sender" This is my header: Code: [Select] $headers = "From: XXXXX\r\nReply-To: XXXX@XXXXX.com"; $headers .= "\r\nContent-Type: text/html; charset='iso-8859-1' Content-Transfer-Encoding: 7bit"; I read somewhere that removing the "\r" would work but no luck... any help would be awesome Hey all, I keep getting this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2 When I use the script below. I'm finding it a bit confusing because everything about it continues to work, it's just it gives me an error. When the script runs, the outcome is "Success! Your dog now looks far more energetic! Looks like this food is all used up." Followed by the error, which cuts the remainder of the page off. Does anybody know why it's doing this? $dogyay = $_POST['dogid']; $checkenergy = "SELECT energy FROM dogs WHERE id=$dogyay"; $energylevel = mysql_query($checkenergy) or die(mysql_error()); $row = mysql_fetch_array($energylevel) or die(mysql_error()); if($row['energy'] >= 100) { echo "<b>Oops!</b> Looks like your dog is full right now...";} else{ echo "<b>Success! Your dog now looks far more energetic!</b><br><br>"; $sql11="UPDATE dogs SET energy=energy + 50 WHERE id=$dogyay"; $result11=mysql_query($sql11); $sql12="UPDATE items SET uses = uses - 1 WHERE itemid=$id"; $result12=mysql_query($sql12); $checkuses = "SELECT uses FROM items WHERE itemid=$id"; $useslevel = mysql_query($checkuses) or die(mysql_error()); $row = mysql_fetch_array($useslevel) or die(mysql_error()); if($row['uses'] == 0) { echo "Looks like this food is all used up.<bR><br>"; mysql_query("DELETE FROM items WHERE itemid='$id'") or die(mysql_error());} Thanks ! Hello again, Though this question is somewhat related to my prior note, I thought it was probably different enough to justify a separate topic... So, I have a link at site1.com/dir/admin/?param1=value¶m2=value, etc, which I want to redirect to site2.com with all the rest being the same. Thanks to your help, it's working with two specified parameters However, there is a relatively short list of potential parameters (maybe 5?) but not all of them are passed in all calls to the link. In other words, sometimes the link is called with param1 and param2, sometimes with 1 and 3, sometimes with 1,2, and 4, etc. What is the best way to do the redirect which would ensure that all the parameters which are sent to the initial link are then included in the redirect? Is there a way to search the incoming link and grab all parameters in it? Or do I put together the list of possible parameters and then grab the values with $_GET for all of them and then pass all of them even if the values are null (not sure whether the app will accept that or not...) I hope I'm stating the question clearly enough! Thanks in advance for your help! I'm a newbie, can you please help? I'm getting a mysql error "Unknown column 'E0000001' in 'where clause'" The id is in the URL: ...user-profile.php?id=E0000001 My Query $query = mysqli_query($con, "SELECT * FROM UserList WHERE UserID=".$id) or die (mysqli_error($con)); Thank you Edited September 18, 2019 by ACBMSEIm trying to make a script that draws the track for a game that i in development, Im stuck on something though. For some reason my script is drawing lines from 0,0 to the x,y of the start position to the x,y of the end position. I have no idea why. Here is the script <?php header ("Content-type: image/png"); $im = ImageCreate (700, 400); $background = ImageColorAllocate ($im, 255, 255, 255); $line = ImageColorAllocate ($im, 0, 0, 0); $trackcode = file_get_contents('test.txt'); $type = split("#", $trackcode); $line = split(",", $type[0]); $sline = split(",", $type[1]); for($i=0; $i<count($line); $i++) { $section = split(" ", $line[$i]); for($j=0; $j<count($section); $j+=2) { $startx = base_convert($section[$j],32,10); $starty = base_convert($section[$j+1],32,10); $endx = base_convert($section[$j+2],32,10); $endy = base_convert($section[$j+3],32,10); //echo "startx: $startx | starty: $starty | endx: $endx | endy: $endy <br>"; imageline ($im,$startx,$starty,$endx,$endy,$line); } } ImagePng ($im); ImageDestroy ($im); ?> You can echo the data if you want to see the raw coordinates. You will need to make a file called test.txt and put this in it for it to work Code: [Select] 42 1i 5u a,8e a 8e -a 8e -u 8e -1i 92 -18 92 0 9m a aa 0 au -a au a,8e -1i 9m -26 au -1i aa -18 9m -1i 92 -18,6i a 84 a,b8 -a b8 a cg u d4 k do u do a do -a do -u cg -1i bs -18,do -u d4 -k bs -18,b8 -a bs -k bs 0 cg a d4 0 d4 -k,e2 k e2 -1i em -18,e2 -u em -k em u,fa -u fu -k gi -u fa -1i em -18,fu -k fu k fu u,gi k gi -u,fa -u em -k,6i a 5u a,gs -u gs 0 gs a i4 u jc a jc -u,gs -18 gs -u,gs -18 hg -1i hg 0 gs a,hg 0 i4 a io 0 jc a,io 0 io -1i jc -18 jc -u,jm a ku u li k m6 u m6 a,jm a jm -a ka -k ka 0 ku a li 0 li -k m6 -u m6 a,li -k ka -18 ku -1i m6 -u,mg a no u p0 a p0 -a oc -k no -u,oc -k p0 -u no -1i no -18 no -a,mg a n4 0 no a oc 0 no -a,qi a qi k r6 u r6 0 t2 u t2 a se 0 t2 -a,qi a qi -a,qi -1i qi 0,qi -1i rq -26 t2 -1i t2 -u t2 -a,r6 -18 rq -1i se -18 t2 -1i,se -18 se -k rq -a r6 -k r6 -18,qi -1i r6 -18,tc k u0 u,tc k tc 0 tc -18 u0 -1i u0 u,ua a vi u 10q a 10q -k 10q -1s 106 -26 106 -1i,ua a ua -a ua -u uu -k uu 0 vi a 106 0 106 -k 10q -u,ua -u vi -1i 106 -18 106 -1i,106 -k vi -u uu -k,114 a 12c u 130 k 11o 0 11o -a,114 a 114 -a 114 -u 12c -1i 13k -u 130 -k 130 -a 130 0 13k -a 13k -u,130 -k 12c -u 11o -k 114 -u,11o -k 11o -a,13u k 13u -u 13u -18 14i -1i 14i 0,13u k 14i u 14i 0,17m a 19i 1i 1es 1i 3d2 1i,pa a q8 a,8e a 9m u au a,e2 k em u,gi k fu u,42 1i -1mm 1i,17m a 14s a#9m -1i 9m -a aa 0,9m -a 92 0,bs 0 cg -a cg -u,cg -a d4 0,bs -k cg -u,em -k fa -a fa a fu 0,fa -a fu -k,em 0 fa a,hg 0 i4 -a io 0,hg -k i4 -u i4 -a,i4 -u io -k,ka 0 ku -a li 0,ku -a ku -u,ka -k ku -u,no -1i mg -u mg -a n4 0,mg -u no -a,no -u n4 -k,r6 -18 rq -u rq -a,rq -u se -18,tc -18 tc -1s u0 -1i,uu 0 vi -a vi -u,vi -a 106 0,11o -k 12c -a 12c a,12c -a 130 -k,130 0 12c a,14i -1i 156 -18 156 -k 14i -u# I have no idea why it isnt working properly, any help will be greatly appreciated. I GET QuoteFatal error: TPL: [in line 0]: syntax error: file 'm/pg/_categories' does not exist in C:\WebServ\httpd\libs\tpl\class.template.php on line 943 unset($_templatelite_tpl_vars); else: $_templatelite_tpl_vars = $this->_vars; echo $this->_fetch_compile_include($this->_vars['TPLx'].'m/pg/_categories'.$this->_vars['HTML'], array()); $this->_vars = $_templatelite_tpl_vars; WITH FILES http://testynarkotykowe.j13x.pl/index.txt && http://testynarkotykowe.j13x.pl/indexpg.txt HOW TO FIX IT i am trying to upload a .sql file on godaddy database and i am getting this error . Help me.
|