php

Div tag does not contain content.

I've created a form that enters comments onto my blog posts but when the comments are displayed on the webpage the background color that I added to the div is either to big or to small. I've provided the code below. Any help is appreciated! <h2 id="comments-title">Comments</h2> <div id="comment-list"> <?php } $commenttimestamp...

Help with Regular Expression In PHP

I want to get an array of the following types of strings: data {string1} {string2} {string3} data I want to get an array whose values are string1/string2/strin3. How can I do this? ...

issue with preg_replace

Hello, This is a simple one :) I have this line which works great: $listing['biz_description'] = preg_replace('/<!--.*?--\>/','',$listing['biz_description']); What is the proper regex to remove the html entity version? This is the entities: &lt;!-- --&gt; ...

cUrl not working in PHP

I am trying to have a php script that displays a url with user data in it. The script is shown as follows. <?php $url = "localhost/" + $_GET['type'] + "/" + str_replace(' ','%20',$_GET['message']) + "/"; print $url; // create curl resource $ch = curl_init(); // set url curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_P...

Simple or comparison doesn't work, undefined function ()??

I get this error: Fatal error: Call to undefined function () in /home/gmfeedsc/domains/cekdahl.com/public_html/virek/system/application/views/rekommendationer/visa.php on line 263 And that row is: <?php if ( ($post['users_id'] == $this->userId) || ($this->userLevel > 0) ): ?> And I can't figure it out. I guess it is becau...

Javascript & PHP :: What to do ??

I have a string, get by Javascript (the content of a div!); I want to write this string to PHP, because i want a text file with this content! How is the best way to do this? Edit[1]: Method Post doesn't works, because i have '<' chars and it erase them (i don't know why)... Example: I have #include <stdio.h> and when i call echo $_REQ...

$_POST multidemensional array looping

Hello! So I've created a form wich, by the post function, send me several values. $_POST[groups] sends me, using 4 different checkboxes values 1, 2, 4 and 8. $_POST[retailgroup] does the same, but only the values 1, 2 and 4. The problem is that I want these to add up together and then send the sum of the values to a MySQL table. I've man...

How to list all of the files in a directory and its subdirectories with php

I'm attempting to use a sample function on the PHP manual website (posted by a user). The function is supposed to return a nested array of all of the files and/or folders in a specified directory of your server. I'm just learning php, so I think it's more likely that I'm doing something wrong, and less likely that the function doesn't ...

How to start reading txt file from a specified line using PHP?

Hello, I have a txt file that has a change-log.I'm trying to display the new changes only for the current version. I wrote a function to read the file and check every line if it has the wanted words, if it finds those words it starts to get the content and push it to an array. I searched to see if there is an example but everyone was t...

Filtering a list based on conditions

The problem I have a list of tasks with which a user is greeted with upon login. I want to be able to filter tasks according to assignment. The relevant fields on the table are: **tasks table** task_id | (FK int) user | (FK int) team (assigned to) (assigned to) And users belong to one team. On the front end I have c...

Getting the field_image path in Drupal 7

Hey everyone, In Drupal 6, I would do the following to get images in my node--articles.tpl.php page: <?php $cck_images = $node->field_image; if (count($cck_images)>0) : foreach ($cck_images as $cck_image) : $image = theme('imagecache', 'large', $cck_image['filepath'], $cck_image['data']['alt'], $cck_image['data']['title'])...

How to remove Search Box from page if no result?

I have two search boxes, one on top, and one on bottom. The content is in the middle, if found no results, how do I remove one of them? (bottom one) Thanks I got this for the form: <form class="form" name="search" method="_post" action="index.php"><br> <input style="width:300px; height:28px; vertical-align:middle;" class="searchbox" t...

Upload KML file into database and display on OpenLayers Map

Hi, I want to create a simple form on my wordpress site so that people can upload KML files which will then be stored in the db and the route shown on on openlayers map - openstreetmap. The project is for a hiking site for storing hiking routes. Any docs for this/ forums / advice. I'm completely new to this map stuff. Cheers Andy ...

Java & PHP sessions

Hi, I'm creating a Java applet which communicate with my PHP website by requesting pages and retrieving their contents. It works pretty well and it allows my applet to use PHP sessions. However, I tried to launch the applet with Opera (instead of Firefox), and it appears that Opera doesn't let my applet use its PHP session, and as Java...

Allowed memory size of..

"Allowed memory size of 138412032 bytes exhausted (tried to allocate 71 bytes)" ive got this error on WordPress Admin site - what thats mean??? ...

PHP string manipulation help with timestamped files

Hi guys, i'm trying to work out the best way to remove a timestamp from a filename using php's string functions. The timestamp is split from the rest of the filename by an underscore on the left, and the dot to start the file extension on the right (e.g myfile_12343434.jpg) - I only ever want the text prior to the underscore although the...

PHP RSS caching

Hello, I was looking for a solution on caching RSS feeds in PHP. I was planning to do the parsing with Magpie RSS parser (http://magpierss.sourceforge.net/). But then how could I go about caching feeds (in case sometimes feed provider won't let me read the same feed, etc.)? Regards. ...

Concerns regarding potential Regex misuse?

Hi, I have the following regex: ^[a-zA-Z](.*)[a-zA-Z]$ on both the Javascript and PHP side that I have been using for validating a person's name and message fields on a contact form (no database interaction). It basically ensures that the first and last character in the field are alphabets, and allows anything else in-between. My conc...

Email Notification on new MySQL database entry.

I've been creating a blog using tutorials around the web and I have a working comments system but what I would like is if when the user adds a comment that I get an email. I'd really love if you could explain how exactly I could go about implementing a notification. Any help is greatly appreciated. Current Form: <form id="commentform" ...

Using PHP function include() to include a png image.

Ok people, despite the best-known-practices, today I decided to do this: <img src='<? include("dir/dir/img.png"); ?>'> With 6 diferent .png images. Sadly, only 2 of the 6 were nicely visible on the browser. Why only 2 of the 6 images were shown? Maybe there were data losses bits on the way? Thank you for your time :] ...