iarp
Members-
Posts
326 -
Joined
-
Last visited
Everything posted by iarp
-
Try adding !important just after the css entries you want to keep. ie.. #content { width: 1000px !important; } It'll make sure that that is the value to follow. Also need to counter balance any other css values the other one contains that you don't want... like margins and paddings and backgrounds and such.
-
<?php if(!isset($_COOKIE['cms_theme'])) { $r = $cms->cquery('theme'); setcookie('cms_theme', $r); $url = $_SERVER['REQUEST_URI']; header("Location: $url"); } elseif (isset($_GET['theme'])) { $get = escape_data($_GET['theme']); setcookie('cms_theme', $get); $url = $parts[0]; //$parts[0] = everything before the ? header("Location: $url"); } ?> Problem, whenever i view example.com and then view example.com/programs/ i keep getting more cookies made. Ive installed an addon in FF so i can see what cookies are related to the website i'm working on and it's path shows / and the others /programs/. How is a path set for a cookie so that no matter where the cookie is called wether it be / or /programs/ or /gui/ it's always the same one.
-
There any ways todo this besides adding if statements to every link on every page?
-
Hey, Question... On my site i have the ability to add ?theme=blahblahhere and it'll change to that theme temporarily. But i'm wondering if theres an ability out there to have the GET['theme'] attribute added to all internal links so that when you change pages you don't need to manually add it.
-
After reading Zephyr_Pure reply i realized the way i have it setup the $parts array would be accessible within the requested file. And then just carried on with normal operations. Thanks
-
You could try $_SERVER['HTTP_REFERER'] http://ca2.php.net/manual/en/reserved.variables.server.php 'HTTP_REFERER' - The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.
-
Is there anyway possible todo so? <?php ob_start(); session_start(); session_regenerate_id(); $errors = array(); require_once('iarp-settings.php'); require_once('includes/iarp-core-functions.php'); require_once('includes/iarp-core-classes.php'); $cms = new iarp_main(); $content = new iarp_pages(); $content->setvals($_SERVER['REQUEST_URI']); $parts = explode('?',$_SERVER['REQUEST_URI']); $p = 'themes/' . $cms->theme(); if ($_SERVER['REQUEST_URI'] == '/') { $p .= '/index.php'; } else { $p .= $parts[0]; } if (file_exists($p)) { if (!empty($parts[1])) $p .= '?' . $parts[1]; require_once($p); } else { require_once('themes/default/index.php'); } mysql_close(); ob_flush(); ?> In a nutshell the above code checks the url against files contained in the themes folder, but if someone adds ? and anything after that to any of the file names it's unable to be require()'d All i get is: Warning: main(themes/default/file.php?uid=1) [function.main]: failed to open stream: No such file or directory in /homepages/31/d204952132/htdocs/iarp/main/iarp-load.php on line 29 Fatal error: main() [function.require]: Failed opening required 'themes/default/file.php?uid=1' (include_path='.:/usr/lib/php') in /homepages/31/d204952132/htdocs/iarp/main/iarp-load.php on line 29
-
I'm unsure whats wrong with yours, i use the following. $HTML = your message content/body. $headers = "From: $from\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $boundary = uniqid("HTMLEMAIL"); $headers .= "Content-Type: multipart/alternative;". "boundary = $boundary\r\n\r\n"; $headers .= "This is a MIME encoded message.\r\n\r\n"; $headers .= "--$boundary\r\n". "Content-Type: text/plain; charset=ISO-8859-1\r\n". "Content-Transfer-Encoding: base64\r\n\r\n"; $headers .= chunk_split(base64_encode(strip_tags($HTML))); $headers .= "--$boundary\r\n". "Content-Type: text/html; charset=ISO-8859-1\r\n". "Content-Transfer-Encoding: base64\r\n\r\n"; $headers .= chunk_split(base64_encode($HTML));
-
Is there any real difference between using type="text" or type="password" ? Someone told me the browser handles it differently because its supposed to me more secure.. but its still handled by regular POST or GET.
-
Function: <?php function menu($name, $class='') { $uri = $_SERVER['REQUEST_URI']; switch($name){ case 'menu-main': $r = mysql_query("SELECT page_name, page_url FROM " . CONTENT . " WHERE menu_id = 'main' AND page_active = '1'"); while($row = mysql_fetch_array($r, MYSQL_ASSOC)){ echo "<li"; if ($row['page_url'] == $uri) $class .= ' current_page_item'; echo " class=\"" . $class . "\""; echo "><a href=\"" . $this->base() . $row['page_url'] . "\">" . ucfirst($row['page_name']) . "</a></li>\n"; } break; } }?> Page: <?php $cms->menu('menu-main', 'page_item'); ?> Table: TABLE `content` ( `menu_id` varchar(20) NOT NULL default '', `page_name` varchar(255) NOT NULL default '', `page_url` varchar(255) default NULL, ) The site location: http://cms.iarp.ca/ While on the home page, the menu links all contain current_page_item, when you view Haiz, home doesn't but the rest do... and so on as you click each page. I've spent abit trying to figure out what i'm doing wrong and i'm stuck. Help please. The Problem: Only the current page your viewing, should have the current_page_item class.
-
Hey, Was unsure if this should've been posted here or in php help. Is it in best practice to add the ending , $link); to things like mysql_query(.....,$link) and such or should i only worry about that when using 2 databases?
-
Makes sence, long slow night here. Thanks
-
<?php if (($_REQUEST['title'] != 'Main_Page') || ($_REQUEST['title'] != 'disclaimer')) { ?> blah blah text <?php } ?> So using the above i figured it wouldn't show 'blah blah text' if i was on Main_Page or disclaimer, but it does. If i remove one of the != statements it works as it should. It's probably something stupid i'm missing here.
-
Works like a dream, thank you.
-
I thought this was going to be a simple form to change a cookies value, but i can't figure out wtf is wrong. I'm in need of assistance please. <?php require_once('MDS_includes/header.php'); if(isset($_POST['submitted'])) { $temp = $_POST['links']; $t = $temp; $expire = time()+60*60*24*30; setcookie("mds_viewtype", $t, $expire); } ?> <form action="prefs.php" method="post"> <label>How would you like product links to open?</label><br /> <input type="radio" name="links" value="1" id="501" <?php if ($_COOKIE['mds_viewtype'] == '1') echo checked; ?> /><label for="501">Not in a popup maner</label><br /> <input type="radio" name="links" value="2" id="502" <?php if ($_COOKIE['mds_viewtype'] == '2') echo checked; ?> /><label for="502">With javascript popups(default)</label><br /> <input type="submit" name="submit" value="Submit" /> <input type="hidden" value="submitted" name="submitted"/> </form> <?php require_once('MDS_includes/footer.php'); ?>
-
Email output: --15:00:01-- http://list.domain.ca/admin/consume.php => `consume.php' Resolving list.domain.ca... 74.208.60.144 Connecting to list.domain.ca|74.208.60.144|:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] 0K 0.00 B/s 15:00:01 (0.00 B/s) - `consume.php' saved [0]
-
[email protected] */20 * * * * /usr/bin/wget http://list.domain.ca/admin/consume.php >/dev/null thats what the crontab is setup todo, so basically every 20minutes it runs consume.php In my root directory, i'm getting files like this: consume.php consume.php1 consume.php2 i woke up this morning with 24emails and consume.php1 - consume.php24 can someone please tell me why it's doing this and/or how to stop it.
-
[SOLVED] Wordpress, 2 querys one the same page, need to clear the first
iarp replied to iarp's topic in Applications
print($post1->post_title); did the trick -
I have these 2 query's each grab certain types of posts according to their category SELECT post.ID, post.post_title, terms.name FROM $wpdb->posts AS post, $wpdb->terms AS terms, $wpdb->term_relationships AS tr WHERE (post.ID = tr.object_id) AND (tr.term_taxonomy_id = terms.term_id) AND terms.name = 'Newsletter' AND post.post_status = 'publish' AND post.post_date_gmt < '$today' AND post.post_type != 'page' ORDER BY post.post_date DESC LIMIT 5")) { ?> and SELECT post.ID, post.post_title, terms.name FROM $wpdb->posts AS post, $wpdb->terms AS terms, $wpdb->term_relationships AS tr WHERE (post.ID = tr.object_id) AND (tr.term_taxonomy_id = terms.term_id) AND terms.name = 'Events' AND post.post_status = 'publish' AND post.post_date_gmt < '$today1' AND post.post_type != 'page' ORDER BY post.post_date DESC LIMIT 10")) { Both are basically the same exact one terms.name = '' says Newsletter and ones Events. Having both of those query's in my sidebar.php page... the actual < a > link part is fine and works, but the_title() displays the last result of the first query Any insight what i can do to clear the_title or something. I've tried <?php $wpdb->flush(); ?> everything and it doesn't work... even right after the query themselves. This is the output code: <?php $today1 = current_time('mysql', 1); if ( $eventposts = $wpdb->get_results( " SELECT post.ID, post.post_title, terms.name FROM $wpdb->posts AS post, $wpdb->terms AS terms, $wpdb->term_relationships AS tr WHERE (post.ID = tr.object_id) AND (tr.term_taxonomy_id = terms.term_id) AND terms.name = 'Events' AND post.post_status = 'publish' AND post.post_date_gmt < '$today1' AND post.post_type != 'page' ORDER BY post.post_date DESC LIMIT 10")) { ?> <ul> <?php foreach ($eventposts as $post1) { if ($post1->post_title == '') $post1->post_title = sprintf(__('Post #%s'), $post1->ID); echo "<li><a href='".get_permalink($post1->ID)."'>"; the_title(); echo '</a></li>'; } ?> </ul> <?php } else { ?> <ul> <li>No Events at this time</li> </ul> <?php } ?>
-
Hey, Trying to make a page that has a box 100% wide, 75px high has an image being repeated on the x axis and another image center in the middle. That way any screen size, the image centered will always be in the middle of the page. I've tried tables and divs and such and can't get anything to float in the center vertically. Any help?
-
Hey, in the database: <div id="legal"> <a href="/tos/">Terms of Service & Use</a> | <a href="/privacy/">Privacy Policy</a> </div> Whenever i try to display this entry from the database in an <input> as such: <label>Legal:</label> <input class="config-input" type="text" name="legal" value="' . $config['legal'] . '" /><br /> The first quote " screws everything up on the page. What must i change?
-
very nice, thank you.
-
Hey, index.php switch($_GET['action']) { case 'contact-form': contactForm($_POST['name'], $_POST['email'], $_POST['phone'], $_POST['subject'], $_POST['comments']); break; } contactform function ...... cut everything above to save space. if (empty($errors)) { //if everythings ok //Send e-mail with comments $body = "Name: " . $name . "\nPhone: " . $phone . "\nE-mail: " . $email . "\n\n" . $comments . " "; mail ('[email protected]', '[Website] '.$subject, $body, 'From: '.$email); echo '<h1>Thank-you!</h1><p>Your message was successfully sent,</p><p>If you had any questons we will try to respond ASAP.</p><br /></p>'; } else { return $errors; } furthur down the index.php page outside of the switch statement. <?php if(isset($errors)) displayErrors($errors); ?> but $errors isn't usable outside of the switch statement. how can i make it globally usable. i tried global $temp1, $temp1 = $errors but didn't work. TIA
-
Hey, I'm no good at writing programs, and would have no idea where to start. So i'm wondering, can PHP get computer MAC addresses or serial/model numbers?