Jump to content

xProteuSx

Members
  • Posts

    476
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Vernon, Canada

xProteuSx's Achievements

Advanced Member

Advanced Member (4/5)

1

Reputation

1

Community Answers

  1. PHPFreaks folks, How in the heck do I name an array within an array (multidimensional array), so that I can bring it up by array name instead of array number? Please help me out here -- its over my head, I guess.
  2. Maybe I am not understanding your suggestions (thanks by the way!), but the themes that I am thinking of are drastically different so I am not sure I can adopt your suggestions. These themes do have a core style.css file, but each and every theme has completely different content formatting for each page, so calling up different .css files won't do the whole trick. I've implemented a temporary work-around, that I am confident I will be frowned upon by one and all: www.website.com/index.html -> all content = include('theme/' . $themedirectory . '/index.html') www.website.com/about.html -> all content = include('theme/' . $themedirectory . '/about.html') www.website.com/contact.html -> all content = include('theme/' . $themedirectory . '/contact.html')
  3. I am starting a project that is way over my head. As usual, I will be learning a lot as I go. The short and skinny: a website that allows users to select which theme they would like to use. My file structure is like this: www.website.com www.website.com/index.html www.website.com/about.html www.website.com/contact.html //default theme www.website.com/theme/default/index.html www.website.com/theme/default/about.html www.website.com/theme/default/contact.html //theme 1 www.website.com/theme/theme1/index.html www.website.com/theme/theme1/about.html www.website.com/theme/theme1/contact.html //theme 2 www.website.com/theme/theme2/index.html www.website.com/theme/theme2/about.html www.website.com/theme/theme2/contact.html So, I think its pretty self explanatory. I would like the URL's to always be: www.website.com www.website.com/index.html www.website.com/about.html www.website.com/contact.html But I want these files to change depending on the theme selected. So, if the user selects "theme 1": www.website.com/index.html -> will display content of -> www.website.com/theme/theme1/index.html www.website.com/about.html -> will display content of -> www.website.com/theme/theme1/about.html www.website.com/contact.html -> will display content of -> www.website.com/theme/theme1/contact.html I have done a bunch of research, but all I seem to find are tutorials and articles about using the include(), include_once(), and require() functions. Any pointers to some better content? Is there a shortcut that can be taken? Something akin to .htaccess rewrite?
  4. I have a website with a series of directories that are created "on the fly". These images are used exclusively for storage of image files, and I've written a script that copies a default index.html file to each directory as it is created. This index.html file has nothing but a redirect script, so that if someone tries to access the directory instead of a file listing they are sent to the home page of the website. Is there any way to achieve this using the .htaccess file? Is there any way to get around having to copy this silly index.html file to every single directory? I don't even know how to phrase this issue for Google ...
  5. Hi guys. I am having a hell of a time finding a WYSIWYG editor that can also handle image uploads. I have a website where I would like users to be able to enter text and images as part of their articles, but not just URLs to images, but to actually upload their images to the site through the WYSIWYG editor so that they can be used in the articles. Is this possible? I can't seem to get a straight answer ... TIA.
  6. Where the heck is the "Solved" button??
  7. Got it working. Did this: $year_value = 'val_' . $_SESSION['add_value_year']; Then: $value = "SELECT rb_values." . $year_value . ", rb_images.img_thumb, rb_images.img_lock, rb_notes.not_general, rb_notes.not_modern, rb_notes.not_specialized FROM rb_values, rb_images, rb_notes WHERE rb_values.val_id = $note[0] AND rb_images.img_id = $note[0] AND rb_notes.not_id = $note[0]"; Then I could use: $row[$year_value]
  8. I've got something like this: $value = "SELECT rb_values.val_" . $_SESSION['add_value_year'] . ", rb_images.img_thumb, rb_images.img_lock, rb_notes.not_general, rb_notes.not_modern, rb_notes.not_specialized FROM rb_values, rb_images, rb_notes WHERE rb_values.val_id = $note[0] AND rb_images.img_id = $note[0] AND rb_notes.not_id = $note[0]"; Then I use mysql_fetch_assoc(), but I don't know how to retrieve the data for: rb_values.val_" . $_SESSION['add_value_year'] . " because that row could be val_2015, val_2014, val_2013, etc. depending on the value of $_SESSION['add_value_year']. I have tried using index number, but to no avail. I really don't know what to do here.
  9. You know, I've always been very grateful for the help that I've gotten on this website. I've always looked into the different options and suggestions that I have received because I know that I am not an expert coder. I've always come back here, and contributed whenever I could (not often because I am not an expert coder). However, the last 10 times of so I've kindly asked for help, I've come up against some prick such as yourself, how deems me too stupid to be worthy of help, or himself too awesome to help. Its really sad to see the website going in that direction. If you don't want to help, just stay out of it.
  10. mac_gyver, Thanks for your reply. I am totally going to have to look into this PDO API stuff. I am putting together some long term projects, and I definitely don't want to be updating all my MySQL queries in a year. In the mean time, database normalization aside, can you help me build the function that I've outlined? Cheers.
  11. I am trying to write a function that I have never attempted before, but would save me TONS of code if I can get it to work. I have a table with an expanding number of columns. The data is annual, so the table column names go something like this: data_2010, data_2011, data_2012, data_2013, etc. With every coming year another column is added, obviously. On the webpage that accesses the data, I have set up variables for each column. However, I have to edit this code every time a new column is added. I am trying to create variables based on column names. Something like this: -> get column names (done!) -> add each column name to an array (done!) -> create variable for each column in the array Here is what I have: function getValueColumns() { $res = mysql_query('DESCRIBE table_name'); $yearcol_array = Array(); while($row = mysql_fetch_array($res)) { $outputrow = "{$row['Field']}"; if ($outputrow != 'val_id') //ignores the table primary key column { $year = substr($outputrow, -4); //checks if the year is included in the table column name if (is_numeric($year)) //if the last four digits of the table name are a number, as in a year ... {array_push($yearcol_array,$outputrow);} } } return $yearcol_array; } So now I have to write the code that will create the variables, and collect the data from those columns at a certain row. Something like this: function returnYearlyData() { $yearswithdata = Array(); foreach ($yearcol_array as $yearcol) { $select = "SELECT * FROM table_name WHERE val_id = x;"; $[column_name_here] = mysql_result(mysql_query($sql), 0, 0); if ($[column_name_here] != '') { array_push($yearswithdata,$[column_name_here]); } return $yearsdiwthdata; } So now I would have an array with variables named after the table column IF the row and column specified in the select statement is not empty. I am not sure whether I have explained this well, but I cannot figure this out myself. I've always been curious as to whether you can append text to a variable name, for example, which is a related scenario. Either way I would appreciate help. Cheers guys and gals! Oh, and happy new year! TIA!
  12. Ok, this is something that I used to know how to do. Its a local windows file, that you edit to redirect your browser when a certain URL is being looked for. The thing is that I have a website that gives me revenue via the eBay Partner Network. Unfortunately, instead of going to my website to click on the link to eBay and then looking for items (so that I can collect revenue on my purchases) I am in the habit of going to my.ebay.com. What I would like to do is have the browser take me to mywebsite.com every time I type in my.ebay.com into the browser. How can I do this? TIA.
  13. My .htaccess files usually contain something like this: AddHandler application/x-httpd-php5 .html .php .htm .shtml This tells the server to look for php code within those file types, and process it as php code, and not plain text.
  14. Seems like you've got this in a .htm or .html file. Try saving the file as .php, and see if the code runs properly. There are ways to make PHP code run in .html or .htm or .shtml files, by editing your .htaccess file.
×
×
  • 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.