Jump to content

asmon

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Everything posted by asmon

  1. I have a website I built for someone a while ago but i used bad coding techniques. I used a class called display and a class called action each page is a 'display' method, and each action (form submit) is an 'action' class method. it's bad because the page is pretty long therefore it takes time to find the method i was looking for. also, the HTML and PHP are combined so i echo all my HTML within the method. My question is, should i just leave it as it is or i rather just rewrite the whole thing?
  2. yah, but i was reading one article and it said something about big classes or using classes for things they are not meant for which is what i am doing here and i'm just wondering if there's something wrong about it.
  3. I have the index.php page and 2 classes index.php, display.class.php, actions.class.php each function in the display class is the page content while the actions class are the POST actions. therefore in the index.php i have a switch for displaying each page if (isset($_POST['submit1'])) actions_class::submit1(); else if (isset($_POST['submit2'])) actions_class::submit2(); switch ($_GET['view']) { case 'register': display_class::register(); break; case 'users': display_class:users(); break; } is there something bad about programming this way? i like it because it's easy to understand and maintain
  4. i have 2 selections 'select_1' and 'select_2' 'select_2' values are being updated depending on 'select_1' it works fine with firefox but i have a weird problem using IE. it looks fine when i select a value from 'select_1' for the first time, but if i select something else, then i select an option i've already selected, it suddenly won't update 'select_2'. do you have any idea what might cause the problem or i should paste the code?
  5. when uploading a file, i move it into a folder but in order to do that, i have to change folder permission to 'write by others' won't it allow anyone just enter that folder and remove\add any file they want? and what can i do about it?
  6. there are websites giving you details such as number of visits for any domain you supply. how can i get and post that information in my website??
  7. I'm giving the user an option to download an excel report. I'm creating the file on the server and giving the user a link to that file. the problem is, the file name is the user's id. any user can just type the url of someone else's xml file. what other options do i have?
  8. I was looking today for tutorials about installing PEAR it looked pretty complicated but then i came into this page http://www.geeksengine.com/article/install-pear-on-windows.html here it seems like all i have to do is copy paste and then include the packages. so what's the difference between including a pear package or someone else's class? another question i have is about mail. I'm trying to send a mail to multiple receipts. the standard way is just separating the receipts by commas but then when i receive the mail, i can see all the receipts who received the mail and i don't want that information to be displayed. what can i do about it? i was reading that looping in order to send a mail many times is a bad idea.
  9. i have a table of categories and a table of subjects. a subject can be related to more than one category therefore i created a 3rd table: category_subject with the relationship between them. then to select it, i'm doing something like this static function select_subjects_by_cat_id($selection, $current_id) { global $db; $new_arr = array(); $query = $db->sql_query("select $selection from $db->subjects_table join $db->subject_category on $db->subject_category.subj_id = $db->subjects_table.id where $db->subject_category.cat_id = $current_id"); while ($result = $db->sql_fetch_array($query)) { $new_arr[] = $result; } return $new_arr; } it works great but then i have to relate many users to one subject. so again, i have to make another table: user_subjects. my site has many relations therefore i'm ending up with many tables is it fine doing it this way or there's a better solution?
×
×
  • 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.