Jump to content

mweldan

Members
  • Posts

    36
  • Joined

  • Last visited

Everything posted by mweldan

  1. Hi james how do we know what inside $formproc. Post the class codes here. thanks
  2. try to check file or folder permission.
  3. I would recommend leave column id for primary key and treat column customer_number to store customer number. Add unique key so it must be unique. It would be lovely if you can show anything you have done so we can see further this issue. Thanks
  4. assuming table named tl_formdata_details is where you will pull data from.. you can put emails in an array , and firstnames in another array. then you can form another array with required formatting. <?php $fnames = array('user1', 'user2', 'user3'); $emails = array('user1@email.tld', 'user2@email.tld', 'user3@email.tld'); $result = array(); for($i=0;$i<count($fnames);$i++) { $result[] = array( 'EMAIL' => $emails[$i], 'FNAME' => $fnames[$i], 'LNAME' => 'CHIMP '.$i); } echo '<pre>'; print_r($result); echo '</pre>'; ?> there must be another way to achieve this. just some idea..
  5. First error message says it all: Warning: require_once() [function.require-once]: open_basedir restriction in effect. File(C:\/httpdocs/smarty/libs/Smarty.class.php) is not within the allowed path(s): (C:/Inetpub/vhosts/liberty.pk\;C:\Windows\Temp\) inC:\Inetpub\vhosts\liberty.pk\httpdocs\include\config.php on line 29 update your open_basedir setting in php.ini to allow these path: C:/Inetpub/vhosts/liberty.pk\;C:\Windows\Temp\
  6. i have some idea to let you start. 1. when the user logged in, you can set their status (admin?/user?/staff?) in session 2. by their status you can redirect them to their respective page. first of all, before these 2 things you would want to do, you might need to alter your database or table structure. it must at least store user status to database, so you can use it to check.
  7. I would say what you try to explain is quite detailed, but still not sufficient to let others help you. for example: 1. it would helpful if you can provide error message you get 2. it would helpful if you explain each item that does not work according to you, as far i can see there are: 1. extras /> on page #1 , which is a questionable content 2. i can see short open and close tag on page #2 <?=$item?> , check your php.ini setting , it looks like php treat it as html. since you run a non profit, is there any way to contribute in my free time? if there is anything i can do without leaving this desk i can help you. i use php and mysql for my day job.
  8. I have created one for the sake of learning. it is not completed but enough to show you how to start. https://github.com/weldan/karipap/blob/master/karipap.class.php
  9. last row order by ascending or descending? // why not try something like this? select DatePosted from blog order by id desc limit 1;
  10. there must be a documentation about it somewhere? otherwise how do you know what query to send to server?
  11. So I think what I want is actually ORM. This is what I want to do: 1. create a class to simplify usage of PDO, have some functions to make it easy to query database 2. extend that class in a class that specifically uses for objects or tables. as far i understand similar to what model in mvc structure (sorry because this is the only one i familiar with) Thank you for your answer.
  12. The root of what I am trying to do is to understand what DAO is and how to implement that in PHP. take a look at this: http://blog.chrisdlangton.com/index.php?article=50 how this different than this: https://github.com/j4mie/idiorm Thank you for your answer
  13. So interface it not required at all? Ok will remove it. Thanks I actually want to know about DAO, so I try to create one. It seems I have gotten far out from what I want to achieve. I did some google search about it and found someone else try to achieve same thing and name it as ORM (object relational mapper) . In your opinion, is it what I try to do now can be called as ORM? (or poor version of ORM?. Hehe ) And if can, I need examples for DAO in PHP if any. Thanks for your answer.
  14. I want to simplify create,retrieve,update,delete process using pdo the class later can be extend to provide methods for specific object similar to model concept on common mvc web frameworks. eg: User, Item I have no idea if I get lost on understanding this pattern. Is what I am doing is on right track?
  15. Hi, Please see this: https://github.com/weldan/karipap/blob/master/karipap.class.php I am trying to create data access object, but somehow confused between data access object and abstraction layer . can someone explain about it? thanks
  16. uploading futurama.. for now i can upload as many i want right? nice.
  17. if you use mode w+, will attempt to create file if not exist. if you use mode r+, will open and write into file, does not care if it exist or not. taken straightly from: http://www.php.net/manual/en/function.fopen.php
  18. if they enter nothing, it will capture this: \n so you will likely have to check for it too. echo (!empty($te) && $te != "\n") ? $te : "nothing";
  19. sorry i think my example was wrong, please see Psycho reply instead. other than that, the date format for search query should be same with what you store into database.
  20. in wordpress, you have to create a page from admin panel to get a page with its own url: eg: http://host.tld/pagename i would assume you know this. to answer your question, you can put page file in your theme directory and use include() or anything related . i would suggest to redirect to its own page, but then you will have to create page for each content, once page has been created, usually it will be displayed in frontend menu, you will have to do something to hide it.
  21. assumed the only field you want to query is Date_Opened, i think something wrong with your sql query, it probably something like this: select * from log where date_opened > $date_1 and date_opened < $date_2 order by date_opened desc;
  22. after writing the data into database you can use any of these functions to get last inserted id. //mysql extension mysql_insert_id(); //mysqli extension mysqli_insert_id(); //pdo PDO::lastInsertId(); //ref //http://php.net/manual/en/function.mysql-insert-id.php
  23. send it as array change name="pp" to name="pp[]" on file that processing it use print_r($_POST) to see how it look like. so you will know how to manipulate it for later.
  24. because on line 5 in sendEmail.php you just bind $_POST['telephone'] value in variable named $telephone. you will get that error message if you did not enter telephone number if i am right. to fix it, you can check if $_POST['telephone'] has been received in sendEmail.php if (isset($_POST['telephone'] && !empty($_POST['telephone'])) ) { $telephone = $_POST['telephone']; } if (isset($telephone)) { //process this }
  25. on wordpress you can put function in functions.php in your theme directory, that including shortcodes, codes to query database and all related. that function will then can be called from template 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.