Jump to content

sader

Members
  • Posts

    268
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sader's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. very strange that it didn't work I did tested code before I was posting it and it worked. anyways this regexp '/<span\\s+style="(.*?)">(.+?)<\/span>/si' could be changed to '/<span\\s+style\\s*=\\s*"(.*?)"\\s*>(.*?)<\/span>/si' this should handle some extra whitespaces and also like mjdamato's regexp does pass <span></span> without inner html
  2. here's the code that I come up to: function replace_span_tag($match) { $out = $match[2]; $style_str = $match[1]; if(preg_match('/font-weight\\s*:\\s*bold/si', $style_str)) { $out = "<b>".$out."</b>"; } if(preg_match('/font-style\\s*:\\s*italic/si', $style_str)) { $out = "<i>".$out."</i>"; } if(preg_match('/text-decoration\\s*:\\s*underline/si', $style_str)) { $out = "<u>".$out."</u>"; } return $out; } $result = preg_replace_callback('/<span\\s+style="(.*?)">(.+?)<\/span>/si', 'replace_span_tag', $str);
  3. OMG sory I mistunerstand ok I will try to make right code
  4. check if this works $s = array("<b>", "<u>", "<i>", "</b>", "</u>", "</i>"); $r = array("<span style='font-weight:bold'>", "<span style='text-decoration:underline'>", "<span style='font-style:italic'>", "</span>"); echo str_ireplace($s, $r, $str);
  5. change this $filePath = addslashes($filePath);$sql= 'INSERT INTO player (path, charname) VALUES ("'.$fileName.'", "'.$charname.'")'; into this $filePath = addslashes($filePath); echo $filePath; $sql= 'INSERT INTO player (path, charname) VALUES ("'.$fileName.'", "'.$charname.'")'; what u get?
  6. I am not uber good at regexp but one way I see is this: function match_wiki_tag($match) { $page = $match[1]; $title = ($match[3] && $match[2]) ? $match[3] : $match[1]; return '<a href="index.php?p=wiki/view&page='.$page.'" rel="nofollow" title="'.$title.'">'.$title.'</a>'; } preg_replace_callback('/\\[\\[([^|]+?)(\\|(.+?))?\\]\\]/i', 'match_wiki_tag', $str);
  7. what happened to me I was redirected to 000webhost also change </align><br> to simply </div>
  8. I'm now looking at your code and I think. Accidentally your code isn't loking somethink like this <!DOCTYPE > <html> <head> <?php session_start(); ?> <link href="/uploadify/uploadify.css" rel="stylesheet" type="text/css" /><script type="text/javascript" src="/uploadify/jquery-1.3.2.min.js"></script><script type="text/javascript" src="/uploadify/swfobject.js"></script> //etc if so then here's your problem u must strat session before any output even white space before "<?php" can mess up everythink here's right way to do it: <?php session_start(); ?> <!DOCTYPE> <html> <head> <link> <script> </head> <body> //....
  9. I just understand now one thing u should substract from rows count the number of items u want to display like so: $offset_result = mysql_query("SELECT id FROM `video`"); $offset = floor((rand() / getrandmax()) * (mysql_num_rows($offset_result)-10)); //just to be sure that u will always be able to retrive 10 videos from offset
  10. didi u try var_dump($_SESSION) in your file ? to see what u have in your session vars
  11. hmm maybe let php do random stuff? $offset_result = mysql_query("SELECT id FROM `video`"); $offset = floor((rand() / getrandmax()) * mysql_num_rows($offset_result));
  12. do u atleast have runing web server on your computer? if no download wampserver(search on google) and install it then create file hello.php with text inside <?php echo "Hello";?> and save it to folder C:\wamp\www Now in any web browser type http://localhost/hello.php thats first steps
  13. <input type="text" name="subject" value="<?php echo $schoolname."-".$coursename;?>"/>
  14. u missed some ' around $row // echo 'Course name: ' . ucfirst($row['course_name']) . '<a href="course_enquiry.php?courseid ='.$row['course_name'].'&schoolname='.$row['school_name'].'"><img src="images/email.jpg" alt="enquire about this course" title="click to enquire about this course"></a><br />'."\r\n";
×
×
  • 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.