Jump to content

ryan.od

Members
  • Posts

    75
  • Joined

  • Last visited

Everything posted by ryan.od

  1. I'm trying to position a YouTube video in IE6, but I cannot get it to respond to margins or padding. You can see the issue here: http://www.hiddenexpedition.com/everest-trailer.html (remember, you need to be using IE6) Any thoughts? Thanks. RyanOD
  2. Basically, I am wondering what is the approach to creating a template system that can take an XML feed as an input and parse it into a XHTML file. I have to create >200 web sites each for a different product in a short period of time (I know that sounds nuts, but that's the way it is). Each product has all of its info in a db that can be fed as XML. I'm thinking I would use XSL to create a template that could take the XML feed, dump it into the template, and output a XHTML file. However, I have never done anything like this. Am I on the right track? Any suggestions? Places to go for help on this topic? I have been searching the web and reading like crazy. I just wanted some advice from everyone here. Thanks a bunch. RyanOD
  3. Woah, woah, woah. I don't want to create separate folders for every product (?). I want to rewrite the URL (the one with the parameters) so it LOOKS like folders, but I want to do it without access to the .htaccess file. Anyone else have any thoughts? RyanOD
  4. I am developing a site that is hosted on Yahoo! In order to set up my include path, I am doing the following. . . ini_set('url_rewriter.tags',''); ini_set('session.use_trans_sid',false); session_start(); $path = ""; set_include_path(get_include_path() . PATH_SEPARATOR . $path); HOWEVER, it has just come to my attention that Yahoo! will NOT provide anyone with the path to the root folder??? Can anyone help me with this? Is there a way I can get this info or set up my include paths? Thanks, RyanOD
  5. Yes, yes, I completely agree. FOR ANYONE READING THIS. . .AVOID YAHOO! WEB HOSTING AT ALL COSTS!! Being denied access to the .htaccess file is a real problem. Unfortunately, I was not with this company when they chose this host. Grrrrrrr. . . Is there really any problem with using. . . http://www.whatever.com/products.php?manu=sony&model=ca-1118-wht . . .rather than. . . http://www.whatever.com/products/sony/ca-1118-wht Should I even worry about it? If I had access to the .htaccess file, no problem! But, I don't want to kill myself for an incremental gain. RyanOD
  6. I want to display search engine friendly URLs, but I don't have access to a .htaccess file (Yahoo!, what the heck?!?!?). Is there another way? If so, can anyone point me in the right direction? Thanks, RyanOD
  7. Right. Oops. I guess I left off a couple $. Thanks for calling my attention to it.
  8. I'm attempting to use OOP for the first time in PHP and cannot get the following code to do anything. Any help would be greatly appreciated: <?php class Menu { public $text; public $url; } $menu_footer_array = array(); $menu_main1 = new Menu(); $menu_main1 -> text = "Products"; $menu_main1 -> url = "products.html"; $menu_footer_array[0] = $menu_main1; $menu_main2 = new Menu(); $menu_main2 -> text = "Services"; $menu_main2 -> url = "services.html"; $menu_footer_array[1] = $menu_main2; $menu_main3 = new Menu(); $menu_main3 -> text = "Contact"; $menu_main3 -> url = "contact.html"; $menu_footer_array[2] = $menu_main3; ?> Really, I'm going to be pulling the text and url info from a db, but until this straightforward attempt works, I'm stuck. I try to output this as follows: <?php include("../oop/menu.php"); ?> <div id="footer"> <ul> <?php for(i=0; i<menu_footer_array.count(); i++){ echo('<li><a href="' . menu_footer_array[i] -> url . '">'> . menu_footer_array[i] -> text . '</a></li>'); echo('<li> | </li>'); } ?> <li>© 2007 <span class="red">Made</span> Products Inc. All Rights Reserved</li> </ul> </div>
  9. Yes, but the problem with that is I want the bottom of the header and the bottom of the image to align because I have a border-bottom on the header that extends across the page. Since the header and the image have different heights, the bottom border will run across the page and through the image. Once I have the two pieces side by side (header on the left, image on the right), how can I insure they have bottom alignment? I have tried vertical-align, but that doesn't work. Thanks for the input. RyanOD
  10. I'm trying to figure out how to set up the following: Product Title Image ------------------------------------------------------------- I'm trying to float the image to the right, but I cannot get both to sit on the underline (which is applied to the h# on the left). How do you use CSS to set up this situation?? I cannot use a left margin on the image because there are a bunch of products and each has a title that has a unique length. Thanks, RyanOD
  11. I have a database with the following two tables: 1. job 2. company Each job entry has its own info as well as a job_comp_id column that corresponds to a a comp_id column in the company db table. This works fine. No problems separating info and getting that info into the db. The most simple way I can explain my issue is as follows: Within a while loop that is working its way through my first $row array (generated from $result = mysql_query($sql)), how can I query a different table? Kind of like 'embedded queries'. I totally understand why I separated the companies from the jobs. However, now it is a pain in the butt trying to work with both tables in one page.
  12. This is what I have currently: <input type="file" name="image_w" size="50" /> <input type="radio" name="featured" value="w" /> <?php if(empty($_FILES['image_w']['name'])){ if($_POST['featured'] == 'w'){ $errors[7] = 1; } } ?> However, the second 'if' statement does not work. . .thoughts??
  13. I appreciate your insight and it is most definitely valid. . .however, I'm not doing a very good job explaining the situation. Rather than bounce stuff back and forth, can you look at the code on the first post and tell me whether or not the way to check a group of radio buttons to see which one is selected is to check if($_POST['radio_name'] == 'radio_value')? I think that is the real question here. Thanks again for the comments you have left. And sorry for the complexity of this simple question! RyanOD
  14. Ok, so there is a form where the admin can submit images and select one of the images to be a 'featured' image. The images are chosen with image text boxes (you know, with the Browse button next to them) while the 'featured' image is chosen with a radio button. As a result of my design choices (bad, I know, but no time to fix properly), an admin could choose to feature an image that he/she did not upload as all choices (white, red, black, green, etc. . .these images are shirts) are available in the radio button group. To sum up, the issue is this: an admin could upload the red, green, and orange versions of a shirt, but accidentally choose to feature the white shirt. . .this is the problem I am trying to catch.
  15. I want to check a file upload against a radio button selection (i.e. if the site owner doesn't upload product x, they cannot feature product x). I tried this, but it won't work. Any help would be appreciated: else if(empty($_FILES['image_w']['name'])){ if($_POST['featured'] == 'w'){ $errors[7] = 1; } } The $_FILES['image_w'] field MUST be filled in if you want to select the radio button with name='w'. This, however, doesn't work. Why not? RyanOD
  16. I have looked around for answers to this question and have found many conflicting opinions. . .if I use PHP 'include' in my web page (i.e. for the menu), will this cause any issues with SEO? The "Nope, no problems, go for it!" lead the "Yes!! That causes a problem!! Don't do it!!" by about 70% to 30%. I think the answer is the latter as PHP is processed server side so everything that is 'included' would already be there before the search engine spider saw the page. Does anyone know for sure what the answer is? RyanOD
  17. Ok, I have a situation where I want users of a site to be able to vote on submitted product. They are only allowed to vote, however, if they haven't already voted on any particular product (no voting multiple times!). What is the best way to track which users have voted on which products? I have tossed the idea around in my head several times and I keep coming back to needing an array in my table to track product numbers users have voted on. I doubt very highly that is the correct solution. Any help would be greatly appreciated. It is quite difficult to search for help on this since 'array' returns answers to questions about db queries. RyanOD
  18. Please post the error message. RyanOD
  19. OK, I fixed this ridiculous problem. I wanted to share the final result so as to save others from the same pain. Also, I don't understand why my solution worked. Hopefully, someone can enlighten me. Initially, the product images on the home page were linked to the actual product pages as follows: echo('<div class="product_mini"><a href="' . $root . 'products?prod_id=' . $row['prod_id'] . '"><img class="product_thumb" src="' . $row[product_image] . '" /></a></div>'); This approach ALWAYS dropped the $_SESSION. However, if I change it to the following (I put a forward slash after the directory name) it maintains the $_SESSION: echo('<div class="product_mini"><a href="' . $root . 'products/?prod_id=' . $row['prod_id'] . '"><img class="product_thumb" src="' . $row[product_image] . '" /></a></div>'); Can anyone tell me why this happens? Maybe it has something to do with targeting the index.html file in a lower directory by just targeting the folder name? RyanOD
  20. Can anyone see why the link to the products page shown below would drop my SESSION? If I change the link to just products.php, the SESSION stays active. The way it is now, the SESSION is dropped (even though the link works fine). $root is defined as "" as this is on my home page. Also, I tried taking $root out and that didn't help. The only way to keep the SESSION alive is to change the link to href="../products/". There must be some sort of conflict with passing a variable in the URL? <?php $sql = "SELECT * FROM product WHERE product_featured = 1"; $result = mysql_query($sql) or die('<p>Unable to perform product query. Error: ' . mysql_error() . '</p>'); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo('<div class="product_mini"><a href="' . $root . 'products?prod_id=' . $row[prod_id] . '"><img class="product_thumb" src="' . $row[product_image] . '" /></a></div>'); } ?> Thanks. RyanOD
  21. Can anyone tell me why sometimes my link to my products page produces the following: http://tablashirt.com/products/?prod_id=3&PHPSESSID=590cbb53e690cdd5729b79f42fd71cb5 and other times it is the following: http://tablashirt.com/products/?prod_id=3 I know the obvious answer might be that in the first case a session has been started. However, every page on this site has the same head.php file included and session_start(); is the first thing in the head.php file. As is the case, there should always be a valid session and every page on the site should have access to the $_SESSION variable. Why then is it passed in the URL only sometimes? Moreover, I have one page that has no access to the $_SESSION variable. All the pages use the exact same include files yet one page doesn't work - all the others do. I actually went through the pain of duplicating the working page in the directory that contains the file that doesn't work and when it is in that directory, it doesn't work either. Weird. Are there directory permission settings that need to be changed. I'm starting to think my problem is a server issue. . .not a PHP issue - or is that just wishful thinking? Thanks. RyanOD
  22. Ok, that is good to know. Apparently, there are no problems in those files. If I put my session_start(); in the head file, does it matter where it goes?? I wanted to make sure it came before ANY content was displayed so I put it before the <doctype> declaration. Is there some reason why putting it there would cause problems. Also, if I am redirecting from the logout.php file with header:, does that cause any conflict with the actual <head>?? I think not, but I'm desperate!! Thanks again!! RyanOD
  23. Thanks, but the session_start(); is in the head/head.php file that both index.php and product/index.php have.
  24. Oh man, I am just going absolutely crazy with this. I don't see how there could be any issue. . .however, there is. I apologize for all the code I am posting, but I am at my wits end. . . Here is the index.html file for products: <?php $path = "/home/tablashi/public_html/"; set_include_path(get_include_path() . PATH_SEPARATOR . $path); $root="../"; include("db/db_connect.php"); include("db/db_select.php"); include("head/head.php"); include("products/body.php"); include("db/db_close.php"); ?> Here is the index file for the main page: <?php $path = "/home/tablashi/public_html/"; set_include_path(get_include_path() . PATH_SEPARATOR . $path); $root=""; include("db/db_connect.php"); include("db/db_select.php"); include("head/head.php"); include("home/body.php"); include("db/db_close.php"); ?> Here is the products/body.php page: <body> <?php include("home/masthead.php"); include("products/maincontent.php"); include("home/subcontent.php"); include("footer/footer.php"); ?> </body> </html> Here is the home/body.php page: <body> <?php include("home/masthead.php"); include("home/maincontent.php"); include("home/subcontent.php"); include("footer/footer.php"); ?> </body> </html> Here is the home/maincontent.php: <div id="wrap"> <img src="<?php echo"$root" . "images/headers/header_fd.gif"?>" alt="Featured Designs" /> <div id="main"> <?php $sql = "SELECT * FROM product WHERE product_featured = 1"; $result = mysql_query($sql) or die('<p>Unable to perform product query. Error: ' . mysql_error() . '</p>'); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo('<div class="product_mini"><a href="../products?prod_id=' . $row[prod_id] . '"><img class="product_thumb" src="' . $row[product_image] . '" /></a></div>'); } ?> </div> And here is the products/maincontent.php: <div id="wrap"> <div id="main"> <?php $prod_id = $_GET['prod_id']; $sql = "SELECT * FROM product WHERE prod_id = $prod_id"; $result = mysql_query($sql) or die('<p>Unable to perform product query. Error: ' . mysql_error() . '</p>'); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo('<h3 id="prod_title">' . $row[product_name] . ' </h3>'); echo('<div class="product"><img src="' . $root . $row[product_image] . '" /></div>'); echo('<p id="prod_description">' . $row[product_description] . ' </p>'); } ?> </div> Here is the masthead.php file that is shared where the login/logout is located. <div id="masthead"> <a href="<?php echo("$root")?>"><img src="<?php echo("$root" . "images/logo.gif")?>" alt="Tablashirt" /></a> <?php include("session/session_default.php"); if(!isset($_SESSION['logged']) ) { session_defaults(); } if(isset($_SESSION['logged']) && ($_SESSION['logged'] == true)){ echo('<span class="login"><a href=' . $root . 'login/logout.php>Logout</a></span>'); } else{ echo('<span class="login"><a href="#" onclick="$(\'#ifxElement\').BlindDown(500);return false;">Login</a></span>'); } include("login/index.php"); ?> <div id="nav"> <ul> <li><a href="<?php echo"$root" . "submit/"?>">Submit</a></li> <li><a href="<?php echo"$root" . "score/"?>">Score</a></li> <li><a href="<?php echo"$root" . "shop/"?>">Shop</a></li> <li><a href="<?php echo"$root" . "registration/"?>">Join</a></li> </ul> </div> </div> And finally, here is the logout.php page: <?php session_start(); session_unset(); session_destroy(); header( "Location: http://www.tablashirt.com" ); ?> 10,000,000 gold stars to anyone who can solve this issue. RyanOD
  25. Ok, here is some more craziness. . . I have the following in my masthead.php file. It is included in every page. if(isset($_SESSION['logged']) && ($_SESSION['logged'] == true)){ echo('<span class="login"><a href=' . $root . 'login/logout.php>Logout</a></span>'); } else{ echo('<span class="login"><a href="#" onclick="$(\'#ifxElement\').BlindDown(500);return false;">Login</a></span>'); } I start the session prior to my <doctype> tag in the head.php file (this too is included in every page). The logout.php file that is called is the following: <?php session_start(); session_unset(); session_destroy(); header( "Location: http://www.tablashirt.com" ); ?> Now, when I click on 'Logout' from anywhere except the product page, it logs out and sends me to the main page. Fantastic! Oddly enough, when I do the same thing from a product page, it send me to the main page, but it doesn't log me out. How can that be?? The code is identical in both cases. Even more weird is the fact that the reverse holds true as well!! If I'm on the main page and I log in, it works fine, but when I click to the product page, I get logged off. Thanks once again. . .RyanOD
×
×
  • 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.