Jump to content

w1ww

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

w1ww's Achievements

Member

Member (2/5)

0

Reputation

  1. It is generated by a CMS, I can't hack the core. I get the list in a variable.
  2. I've a dynamically generated html list like this one: <ul> <li><a href="#">Item 1</a> </li> <li>Item 2<ul> <li>Item 2.1 <ul> <li><a href="#">Item 2.1.1</a> </li> <li><a href="#">Item 2.1.2</a> </li> <li><a href="#">Item 2.1.3</a> </li> <li><a href="#">Item 2.1.4</a> </li> <li><a href="#">Item 2.1.5</a> </li> </ul></li> <li><a href="#">Item 2.2</a> </li> <li><a href="#">Item 2.2.1</a> </li> <li><a href="#">Item 2.2.2</a> </li> <li><a href="#">Item 2.2.3</a> </li> <li><a href="#">Item 2.2.4</a> </li> <li><a href="#">Item 2.2.5</a> </li> </ul></li> <li>Item 3 <ul> <li><a href="#">Item 3.1</a> </li> <li><a href="#">Item 3.1</a> </li> </ul></li> <li>Item 4 <ul> <li><a href="#">Item 4.1</a> </li> <li><a href="#">Item 4.2</a> </li> <li>Item 4.3 <ul> <li><strong class="selflink">Item 4.3.1</strong> </li> <li><a href="#">Item 4.3.2</a> </li> </ul></li> </ul></li> <li><a href="#">Item 5</a> <ul> <li><a href="#">Item 5.1</a> </li> <li><a href="#">Item 5.2</a> </li> <li><a href="#">Item 5.3</a> </li> <li><a href="#">Item 5.4</a> </li> <li><a href="#">Item 5.5</a> </li> </ul></li> </ul> I need to add another "li" before the last "</ul>". How can I do it? Regex or ..? Thanks in advance
  3. Hey, Imagine that I've a text file like: Name: John Doe Age: 38 Place of Birth: New York How can I, for example, get the age of the guy? Thanks in advance .
  4. Hello, Can you guys help me a little bit with this (PHP). Imagine that I've this html code: <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="437" height="288" id="viddler_aae0f0d6"><param name="movie" value="http://www.viddler.com/player/aae0f0d6/" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><embed src="http://www.viddler.com/player/aae0f0d6/" width="437" height="288" type="application/x-shockwave-flash" allowScriptAccess="always" allowFullScreen="true" name="viddler_aae0f0d6" ></embed></object> I want to extract the id field id="viddler_aae0f0d6". How can I do this knowing that every time the id it's going to be different? So basically I want to extract "viddler_aae0f0d6" from this code. Anyone has ideas? I know that this can de done with regular expressions but I'm not sure of how to do it. Regards!
  5. Oh yes, I see. Thank you! Just learned a new thing !
  6. Hello, I've a quick question: $cats = array(1,2,3); and $b = 1,2,3; array($b); They produce different results, but what I want is that when I do array($b) it should show work as array(1,2,3) and it shouldnt turn the first position of the array in 1,2,3. I hope this is clear. Thank you help
  7. It does not work (thank you for trying). What I get is the first 10 results and not the last ones of the database.
  8. Hello, I'm here stuck on this query: $q = "SELECT * FROM mensagens WHERE codSala='$sala' ORDER BY data ASC" I want to get the last 10 results ordered by date where the 1st result is the oldest and the last one is the latest. How can I done that? Thank you
  9. Hello, Imagine that I want to know what will be the date on the Thursday of week #27 of an year? For example, now is week #27, year 2008 and the date on Thursday was 03-07-2008 (dd-mm-yyyy). How can I do that? Thanks in advance, Tiago
  10. Oh! Thanks! And I just spent 3 hours on this!
  11. Hello, I'm trying to add some records to a database but it's not working and I don't why.. Can somebody check the code, please? I think the error in the query because I always get the die function error "There is a problem with our...". if (isset($_POST['continue'])){ // Caso contrario processa o form include("db.php"); // open connection $connection = mysql_connect($host, $user, $pass) or die ("No connection!"); // select database mysql_select_db($db) or die ("No database?!"); // variaveis $fname = mysql_escape_string($_POST['fname']); $lname = mysql_escape_string($_POST['lname']); $mail = mysql_escape_string($_POST['mail']); $logoname = mysql_escape_string($_POST['logoname']); $slogan = mysql_escape_string($_POST['slogan']); $description = mysql_escape_string($_POST['descri']); $website = mysql_escape_string($_POST['website']); $other = mysql_escape_string($_POST['other']); // create query $query = "INSERT INTO order (name, lastName, email) VALUES ('$fname', '$lname', '$mail')"; $result = mysql_query($query) or die ("There is a temporary problem with our service. Please try again later."); $orderid = mysql_insert_id(); $query = "INSERT INTO projects (logoText, slogan, description, other, website, orderID) VALUES ('$logoname', '$slogan', '$description' ,'$other' ,'$website', '$orderid')"; $result = mysql_query($query) or die ("There is a temporary problem with our service. Please try again later."); // close connection mysql_close($connection); } Thanks!
  12. That was the problem! I was coding with dreamweaver. Thanks a lot!
  13. Warning: Cannot modify header information - headers already sent by (output started at D:\wamp\www\pandalho\index.php:1) in D:\wamp\www\pandalho\index.php on line 5 This is the right error. Sorry. In the first line there is a single <?php tag without any spaces! Thank you!
  14. Hello. I searched google and found that the headers already sent problem error is returned if theres a white space. Still, on my script there's nothing on the first line. <?php ob_start(); $inTwoMonths = 60 * 60 * 24 * 60 + time(); setcookie('lastVisit', date("Y-m-d G:m:s"), $inTwoMonths); ob_end_flush(); //show form if (!isset($_POST['sub'])){ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <head><title>Ajuntamento do Pandalho</title> This are the first lines of my script. Why do I keep getting "Warning: Cannot modify header information - headers already sent by (output started at D:\wamp\www\pandalho\index.php:1) in D:\wamp\www\testing\index.php on line 5" Thank you.
×
×
  • 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.