Jump to content

willeadie

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Everything posted by willeadie

  1. Conceptual query. I have access to add html to a server with good SEO juice. As a php guy, static HTML sounds like "wasted time doing things manually." I would therefore like to be able to build php/mySQL-based content "offserver" (i.e., on a different server where I can set things up in php/MySQL), and populate the html pages living on the first server using that DB content. I presume AJAX is really the way to do this, by client-siding most of the actual content. The "SEO" part of things is that I want the content to be indexed (or there's no point in hosting it on that site to begin with). Thoughts on a very basic framework to populate HTML from a different/remote server/DB setup in an index-able way? My main focus is on the AJAX end; I can setup fairly clean php on the other end (although interface thoughts welcome there, too). Also, I wouldn't technically need it to be "interactive" at all--the main value of AJAX--so maybe there's an even simpler solution i haven't thought of. TIA.
  2. Went to A2hosting and got up and running in about an hour. 5.3, the works. Good stuff so far. I wish GD hadn't kept telling me I could somehow compile 5.3 on a shared server. Total waste of time.
  3. Tried for a month to get GoDaddy up and running on 5.3. Terrible. Went to A2 hosting, up and running very quickly; can even use ver. 6!
  4. Yeah, that's the point of this thread at this point: if I have SSH access to a shared server, is there a way to load 5.3 on the server. It's either get the server to 5.3, or get a new host. So, does anyone have a suggestion, if looking at the SSH command line, what i need to type to see if I have access? The earlier suggestion was gcc --version but gcc wasn't on there. Other compiler names to try? Again, this is all new, but I figure i can at least exclude this possibility.
  5. Yes, this is shared hosting and I assumed I wouldn't be able to get to 5.3 on my own, either, but their support keeps telling me that, in fact, I can do it on my own. So, while I am close to just giving up, I'm hoping someone can sort out what the support is telling me. I can get to the server command line via SSH. I can see the php.ini info for my files. What, if anything, would i enter on the command line to determine whether I can upload php files and/or add whatever library makes 5.3 able to handle late static bindings?
  6. OK, I'm getting suggestions regarding changing the php.ini file, but I'm not sure if this is going to affect whetehr I can use 5.3-only features (like late static binding). doesn't sound right. Thoughts?
  7. Using PuTTY I can get SSH access to command line. I typed gcc --version and got -bash: gcc: command not found Does this mean i don't have shell access? This is all new to me, so basic explanations are welcome.
  8. OK, assume that the host will provide no instructions (that's their position, anyway). What information would I need to provide you? I'll find out! I appreciate the need for information, and I don't want to waste your time, so all I can do is assure you I'll be attentive and track down what you need. The problem is, i know so little about servers that I don't know the questions to ask. but they assure me I can affect the php. Are there libraries i can add to make the difference? Fines I can upload? I'm not even sure what I'd do if I did have a dedicated server. Help!
  9. Hi everyone. OK, I built a site using php 5.3 (wampserver 2.0 on my machine), went to upload everything to a server and discovered that the host doesn't support 5.3 yet (and I used a lot of late static binding, etc.). Long story short, shared Linux server, and support at host says, "you can upgrade to 5.3, but we won't tell you how since it's 3rd party stuff. But you can do it." Yes, I get it, terrible hosting company. I have no control over that right now--I need this live in hours, not weeks. Can you provide a simple explanation of how I can compile/upgrade/whatever a Linux shared server from 5.2.8 to 5.3? I have access to the root, I think, and I've created the MySql database and got the php to connect just fine. I can put a php5.ini and htaccess or any other stuff. They're also using phpMyAdmin, which is nice, since I'm familiar with it. What I am is server-stupid in a very real way. Help. . . please? Everything I've found trolling the web is either clearly idiotic or way over my head--I need the in-between description of the actual steps I would take to get the php to 5.3 with a quickness. or a resource, or a clue. Anything would be appreciated. Thanks!!!
  10. duh, i just cut out the for statement and put in: static::$db_fields = $db_array; so now I output the correct array. Can I change $db_fields without running the function through __construct on instantiate? Not sure it matters, but may not have an instantiation (so, can i do it on the class, not object, level). thanks!
  11. Indeed. OK, I looked neil.johnson's code, and I realize what he is doing is changing the array values on instantiation using __construct (running the function). Is it possible to do this without an instantiation? Just wondering. OK, i use a global variable ($database) b/c all the db info is in that class. Ignore that for now b/c it works (or clue me in on it; I can post that class if you want). So, I adapted the code so that it would work for my stuff, but only the first letter for the name comes into the array for some reason. Here's the function: function class_attributes (){ global $database; if($result_set = $database->query("DESCRIBE ".static::$table_name)){ $db_array = array(); while($i = mysql_fetch_assoc($result_set)){ $field = array_shift($i); $db_array[] = $field; } // (1) at this point I have the right names in the array! // this should assign the array values to the $db_fields array for($x = 0; $x < count($db_array); $x++) { static::$db_fields[] = $db_array[$x][0]; } } } and here's the array (print_r()) at point (1) [edit--this is what I had already]: Array ( [0] => id [1] => first_name [2] => last_name [3] => username [4] => admin_rights [5] => hashed_password ) Here's the array after the for statement [from neil]: Array ( [0] => i [1] => f [2] => l [3] => u [4] => a [5] => h [6] => i [7] => f [8] => l [9] => u [10] => a [11] => h ) Thoughts? Thanks!
  12. I have just given you the code. Got it and looking at it, thanks! Earlier reply was to earlier reply. Will post back.
  13. This is a reply to the first response. I'll look at the second presently. Looks spot on. Not exactly. Within each class I'm making, I have an array called $db_fields = array('id', 'username', 'first_name', 'last_name', 'admin_rights', 'hashed_password') which values ('id', 'username', etc.--the actual word 'id', NOT some user's unique id) are the attributes for the class. Right now, I manually create the $db_field array for a class, based on the field names in the db table for that class. What I want to do is--instead of manually entering those array values like 'id' and 'username'--populate that array based on the field names in the db table. My function outputs those values as so, on a print_r(): Array ( [0] => id [1] => first_name [2] => last_name [3] => username [4] => admin_rights [5] => hashed_password ) So, how do I go from this to dynamically-building the array. Again, not any actual values, but the actual string 'id' (or whatever the db table fieldnames are for that particular table) Thanks in advance!
  14. Hello, first post, please bear with me. I'm working with classes, and right now the class attributes are set in an array I have to manually create for each class, as such: protected static $db_fields = array('id', 'username', 'first_name', 'last_name', 'admin_rights', 'hashed_password'); What I want to do is have the class attributes array build dynamically from the results of a query to my database. i can get the array i want through a function, but i'm not able to have these values in the class variable, for some reason. here's the array function i built (note that $database is a separate class and that $database->query and similar are just database-independent versions of thins like sql queries): function class_attributes (){ global $database; if($result_set = $database->query("DESCRIBE ".static::$table_name)){ while($i = mysql_fetch_assoc($result_set)){ $field = array_shift($i); $db_array[] = $field; } return $db_array; } } When I try to do something like (and yes, i realize this is all wrong here!) protected static $db_fields = $this-> class_attributes (); I get errors like "Parse error: parse error, expecting `T_FUNCTION'" Thoughts?
×
×
  • 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.