Jump to content

Vince889

Members
  • Posts

    65
  • Joined

  • Last visited

Everything posted by Vince889

  1. Christian, I just tried your suggestion and it still wraps. Any other ideas? DarkerAngel, I tried that and it outputted this: (see attached). Vince
  2. If you view this in IE 8 or even FF 3.6, this menu bar wraps and I cannot figure out why. I've debugged using Firebug and even using my plain ole' eyes. I can't find the issue. http://awt-gpi.com
  3. Hey guys, Why exactly do people use multiplication when calculating time? Like when setting cookies, timeouts or something that requires second-based definitions. For example, some do: $thirty_days = time()+60*60*24*30; As opposed to what I do: $thirty_days = time()+2592000; Why do they do that? Does it help them calculate it without a calculator? Make it easier to manage/adjust in the future? Personal preference? These are the only possible explanations I can think of. This has been bugging me for a while...am I doing something wrong?
  4. I am more of a programmer, rather than a designer. I'd much rather code and make the website do cool things, as opposed to make it look pretty. In short, I suck at designing. Could you guys please critique the following website? Its for an industrial company that sells printers and related equipment. http://3dprintingequipment.com/landing/ Being worked on: - An image rotator in the top-right corner of the screen. - The "Supplies" page. Please ignore this. I mainly want feedback on the landing page and the 'Products page'.
  5. Is there a way to dynamically create subdomains like so: http://sub.example.com ? I can do it in cPanel, but I'm not sure how I would go about doing it in PHP. I know how to create http://example.com/sub, but that isn't what I want. I don't think it would work the same as http://sub.example.com.. - Vince
  6. ....Your setup is fine, that is the messageboard putting those extra characters in.
  7. Again, I am not really sure about what you're looking for. When I parse that string, it comes out as <a href=&#039;test&#039;>Test</a> [just btw, PHPFreak's messageboard is adding its own stuff to our posts. For example, the extra "&#039;"]
  8. Regex would help, but if you want to use str_replace, thats fine. $string = "blahblah navigationID=44"; $replacement = "/en/content/3/Link_Name"; echo str_replace("navigationID=44",$replacement,$string); Atleast I think thats what you want...
  9. If I recall correctly, ENT_QUOTES doesn't do any besides tell the function how to handle double or single quotes [and decide whether or not to convert them]. If you're looking for some kind of special feature, then I don't believe this is what you're looking for.
  10. Would this be much more logical? <? echo "Hello, I am ".$name.""; ?> Or are they fairly the same?
  11. Hey PF. I'm trying to build some better coding habits, so what tips do you guys have? Of course there are obvious things such as well-commented code, neat structure, etc... But I'm looking for some more "TECHNICAL" tips that might be unspoken. For example, when is a good time to use a variable, opposed to a constant? I notice that a lot of programmers define their database settings with define(), while others just use a $variable. Is this personal preference or maybe its something I'm missing? I'm looking for ALL tips. Any information that you have, please share it. It will help make me (And anyone else reading this), a better coder. Thanks in advance. and if this is not the proper forum, please move it! =]
  12. You know... if you run that script, it should be spitting a bunch of errors at you. Try turning error_reporting on and that should be the key.
  13. Take a look here: http://answers.yahooapis.com/AnswersService/V1/questionSearch?appid=YahooDemo&query=test That is a generated XML file from Yahoo's API. If you take a look, it has a node titled "Question". With PHP, how can I loop through each "Question" node and grab all of it's children as well? I tried this code, but apparently it did not work: $req = "http://answers.yahooapis.com/AnswersService/V1/questionSearch?appid=YahooDemo&query=php"; $res = file_get_contents($req); $xml = simplexml_load_string($res); foreach ($xml->xpath('//Question') as $question) { // "//question" means for each question node echo((string)$question['Subject']." - ".(string)$question['Content']); // you get all the child nodes in $question }
  14. I'm not understanding... you want the string to read this? $string = "please enter your user name: <input type=text size=50 value='John'>";
  15. Because the $row variable is being created within a conditional statement, it will only be created IF that statement is true. In the case, the $row variable will only be set IF the numbers of rows DOES NOT equal zero. Obviously, the query is returning 0 and not setting your $row variable. <-- Ignore that, I misread. Its because you're referencing the $row variable before the $row variable even exists. The $row variable isn't defined until here: $row = mysql_fetch_assoc($retrieve); After that, assuming that the conditional statement succeeds, you can use it. Otherwise, if a variable has not been set/defined/exists prior to use, PHP will return an error.
  16. Use double quotes instead of single-quotes. Then, encapsulate your $newdbname variable with single quotes.
  17. Okay... this one is kind of complicated... for me, anyways.But I will try to be as clear as possible. I am using PHP's SimpleXML plugin to handle this XML document generated from Yahoo's API. Incase you aren't familiar, Yahoo's API generates thisupon request. As you can see, the queries the Yahoo Answers database and returns some questions on "PHP". I need to loop through this document and grab the Subject, Content, Date, Link, and Chosen Answer nodes from each Question node. And of course, they will need to be stored in a variable for later echo'ing. I think XPath is what I should be doing, but I have no idea about how I should loop through it and target those specific nodes only. $req = "http://answers.yahooapis.com/AnswersService/V1/questionSearch?appid=YahooDemo&query=php"; $res = file_get_contents($req); $xml = simplexml_load_string($res); That's about as far as I got. Can anyone help? Also, if I'm not clear enough, please let me know!
  18. Excellent, man. It works. Thank you very much.. solved :] And Pickachu, you're right as well. Don't mind me i'm in my own little worldddd. Sorry for wasting you folk's time.
  19. Its just giving numbers [the array key number] and not the actual content. I can't seem to remember how to do this.
  20. I should know this, but i'm having a bad day. If I have: $s = array(); $s[0] = "blah."; $s[1] = "blah blah."; $s[2] = "more blah."; echo array_rand($s,1); Why it return a random number and a warning: I'm just trying to pull a random element from the array without using a complex formula. Now I've done this before but damn, like I said, my day has been full of sh*t. Any help would be appreciated.
  21. Again, amazing. Thank you so much, JoePHP. You're a good man =D
  22. The server wouldn't parse it as PHP unless it is saved with a relevant PHP extension.
  23. Thats excellent work, man! Thank you so much. That had been giving me a headache for a while... and I kept putting it off. One thing though, is it possible to make it stretch across the entire screen? I tried changing the widths from pixels to percentages, but that failed. =\ Would it be best to just increase the pixels and just hope that the user is viewing it in that resolution? Or even better, is there a way to make it stretch across the entire screen, but won't break if the user has a smaller resolution? Instead, it will just automatically adjust? (without a nasty horizontal scrollbar or something)
  24. Can someone please help me out with this? I've been trying really really to make this layout, and its like... killing me. It has to be in DIVS, no borders, solid background color. Gotta be compatible with modern browsers. Can someone please help me out or atleast steer me in the correct direction... so that I can atleast get started or something? Edit: would tables be easier? [attachment deleted by admin]
×
×
  • 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.