Jump to content

waverider303

Members
  • Posts

    62
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

waverider303's Achievements

Member

Member (2/5)

0

Reputation

  1. Hey Paul! I figured this out just using a foreach loop. I basically.... foreach ($data as $k => $v) { if($data[$k]['episode'] <= $currVideo) { $move = $data[$k]; unset($data[$k]); $data[] = $move; } }
  2. Thanks Paul!, This works the only issue I run into is I have an array that is like the following: Array ( [0] => Array ( [episode] => 1 [season] => 1 [id] => 3 [title] => "episode 1" ) [1] => Array ( [episode] => 2 [season] => 1 [id] => 4 [title] => "episode 2" ) [2] => Array ( [episode] => 3 [season] => 1 [id] => 5 [title] => "episode 3" ) [3] => Array ( [episode] => 5 [season] => 1 [id] => 7 [title] => "episode 5" ) [4] => Array ( [episode] => 6 [season] => 1 [id] => 8 [title] => "episode 6" ) ) And I want to sort it by the episode number.
  3. I am looking for information on how to accomplish this: I want to order an array based on a variable. I have an array that is set like this array(1,2,3,4,5,6). I want to order this array base on a variable that will be in the array. So say my variable $x = 3, I want to order the array starting with the number right after the $x. So the array would look like this now array(4,5,6,1,2,3). Is this even possible? Another example if $x = 6, The array would be array(1,2,3,4,5,6). So basically order the array so that the set variable (in this case $x) will be at the end and the rest will run in order.
  4. <?php $server = $_SERVER["SERVER_NAME"]; $pattern = "(?:[^\.]+\.)?example.com"; echo "Server is: $server <br />"; switch ($server) { case preg_match($pattern, $server): echo "Worked"; break; /*case "example.com": header('Location: /~root_folder'); break; case "www.example.com": header('Location: /~root_folder'); break;*/ } ?> This is what I have and i am getting "UnKnown modifier errors"
  5. What is "/^[^\.]+?\." searching for? What I am using to get the domain is $_SERVER['SERVER_NAME']; so it will look something on these lines depending on what they type into the url: hainymedia.com www.hainymedia.com subdomain.hainymedia.com test.hainymedia.com and I want to do a preg_match() to find *(meaning wildcard) .hainymedia.com or even just hainymedia.com (missing the leading .).
  6. I get this error: Warning: preg_match() [function.preg-match]: Unknown modifier '+' in /volume1/web/index.php on line 15
  7. 1. I am trying to match all subdomains of my .com to get redirected to a single folder 2. The input data will be $_SERVER["SERVER_NAME"]; so (*.hainymedia.com) * being anything. So that if they goto f2hd4sak.hainymedia.com it will watch it. I am using a Switch conditional so if it find *.hainymedia.com it will redirect to the same folder. I tried to use "\b[A-Z0-9._%+-]+.hainymedia.com" but I am very new to regex and I dont know what I am doing.
  8. I have list of names in my database with page links associated with them. I want to echo out all the entries with their links associated. I want to have it echo out in a list with letter headings. So it would look something like this: A John Adams Marc Anderson Don Aslid B Bob Backley Doug Buckland C Martha Conners Joan Cooper Lambda Culvers etc.....
  9. IS there a script that will select a couple sentences and display them with all their HTML tags (open and closed) intact? Example would be a blog's index page. It displays a few sentences and it spits out all the necessary HTML coding so that the code isnt broken?
  10. I want to include them but do not want them to count.
  11. I have a database of of blog posts and I want to display only a handful of characters from the post. I know of substr and all those but is there a way to have it ignore html code. MY content in the database includes <p> and <span> tags. I dont want substr to count those as characters so that it wont cut out some of my code.
  12. I am receiving an error. I believe it is due to the version of php/mysql that I am running. Here is the 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 ') VALUES ('', '', '', '', 'home', '', '../images') ('', '', '', '', 'home', '',' at line 1
  13. Is this possible to do? for($s=0; $s==$file_len; $s++) { // SQL Statements $sql = "INSERT INTO `upload_images` (`id`, `image_name`, `img_size`, `img_medium`, `img_title`, `page_name`, `bio_link`, `img_url`, ) VALUES ('', '$image_name[$s]', '$sizes[$s]', '$mediums[$s]', '$titles[$s]', '$page_name', '$bio_link', '$img_url')"; if(mysql_query($sql)){ echo "hello!"; } }
  14. Here is my table layouts: CREATE TABLE `comments` ( `comment_ID` bigint(20) unsigned NOT NULL auto_increment, `comment_post_ID` bigint(20) unsigned NOT NULL default '0', `comment_author` tinytext NOT NULL, `comment_author_email` varchar(100) NOT NULL default '', `comment_author_IP` varchar(100) NOT NULL default '', `comment_date` datetime NOT NULL default '0000-00-00 00:00:00', `comment_date_gmt` datetime NOT NULL default '0000-00-00 00:00:00', `comment_content` text NOT NULL, `comment_approved` enum('Yes','No') NOT NULL default 'No', `comment_agent` varchar(255) NOT NULL default '', PRIMARY KEY (`comment_ID`), KEY `comment_approved` (`comment_approved`), KEY `comment_post_ID` (`comment_post_ID`), KEY `comment_approved_date_gmt` (`comment_approved`,`comment_date_gmt`), KEY `comment_date_gmt` (`comment_date_gmt`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=15 ; CREATE TABLE `banned_comments` ( `id` int(55) NOT NULL auto_increment, `usr_ip` char(15) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
×
×
  • 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.