Jump to content

ted_chou12

Members
  • Posts

    1,488
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://www.netfriending.co.cc

Profile Information

  • Gender
    Male
  • Location
    @ Mars

ted_chou12's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. [[ TOKEN, DOMAIN1, and DOMAIN2 are redactions --requinix ]] Hi, I have a piece of code that I can execute with bash curl without problem: mac70:gsuite_automate ted.chou$ curl -H "Authorization: OAuth TOKEN" https://apps-apis.google.com/a/feeds/domain/2.0/DOMAIN1/sso/general -v * Trying 64.233.187.118... * TCP_NODELAY set * Connected to apps-apis.google.com (64.233.187.118) port 443 (#0) * TLS 1.2 connection using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 * Server certificate: *.google.com * Server certificate: Google Internet Authority G2 * Server certificate: GeoTrust Global CA > GET /a/feeds/domain/2.0/DOMAIN1/sso/general HTTP/1.1 > Host: apps-apis.google.com > User-Agent: curl/7.51.0 > Accept: */* > Authorization: OAuth TOKEN > < HTTP/1.1 200 OK < Content-Type: application/atom+xml; charset=UTF-8 < Expires: Tue, 24 Jan 2017 13:20:21 GMT < Date: Tue, 24 Jan 2017 13:20:21 GMT < Cache-Control: private, max-age=0, must-revalidate, no-transform < Vary: Accept, X-GData-Authorization, GData-Version < GData-Version: 1.0 < Last-Modified: Tue, 24 Jan 2017 13:20:21 GMT < Transfer-Encoding: chunked < X-Content-Type-Options: nosniff < X-Frame-Options: SAMEORIGIN < X-XSS-Protection: 1; mode=block < Server: GSE < Alt-Svc: quic=":443"; ma=2592000; v="35,34" < * Curl_http_done: called premature == 0 * Connection #0 to host apps-apis.google.com left intact <?xml version='1.0' encoding='UTF-8'?><entry xmlns='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'><id>https://apps-apis.google.com/a/feeds/domain/2.0/DOMAIN1/sso/general</id><updated>2017-01-24T13:20:21.003Z</updated><link rel='self' type='application/atom+xml' href='https://apps-apis.google.com/a/feeds/domain/2.0/DOMAIN1/sso/general'/><link rel='edit' type='application/atom+xml' href='https://apps-apis.google.com/a/feeds/domain/2.0/DOMAIN1/sso/general'/><apps:property name='enableSSO' value='true'/><apps:property name='changePasswordUri' value='https://DOMAIN2/sso/DOMAIN1/login'/><apps:property name='useDomainSpecificIssuer' value='true'/><apps:property name='samlLogoutUri' value='https://DOMAIN2/sso/DOMAIN1/logout'/><apps:property name='ssoWhitelist' value=''/><apps:property name='samlSignonUri' value='https://DOMAIN2/sso/DOMAIN1/login'/></entry>mac70:gsuite_automate ted.chou$ But I can't seem to reproduce it with the curl in PHP: $crl = curl_init(); $headr = array(); $headr[] = 'Content-length: 0'; $headr[] = 'Content-type: application/json'; $headr[] = 'Authorization: OAuth ' . $access_token; curl_setopt($crl, CURLOPT_URL, 'https://apps-apis.google.com/a/feeds/domain/2.0/DOMAIN1/sso/general'); curl_setopt($crl, CURLOPT_HEADER, true); curl_setopt($crl, CURLOPT_HTTPHEADER, $headr); curl_setopt($crl, CURLOPT_CUSTOMREQUEST, 'GET'); curl_setopt($crl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($crl, CURLOPT_POST, false); curl_setopt($crl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($crl, CURLOPT_SSL_VERIFYPEER, false); $result = curl_exec($crl); curl_close($crl); echo json_decode($result);
  2. Hi, I have an output of print_r here: Google_Service_Calendar_Acl_Resource Object ( [stackParameters:Google_Service_Resource:private] => Array ( [alt] => Array ( [type] => string [location] => query ) [fields] => Array ( [type] => string [location] => query ) [trace] => Array I am wondering what is the right syntax to create the instance and set the variables? Thanks, Ted
  3. here is the sqlite copy 18947_.tar
  4. Hi, I written this a long time ago, my intention was for my aunt's restaurant, but I guess it was never used. I dig it up somewhere from my files, I took quite some time to write this (although this is in PHP), ie you must have a apache, or lighttpd (php environment) to run it. But I consulted my aunt for a large part of this. I think many ideas and applications can be a good fundamental to start with. Most of all, I don't want it to be wasted. By any chance if someone is looking for a PHP application that could probably be used online, not restricted to restaurant, a bookstore db, or anything, feel free to edit and change to suit your needs. I have the original mysql version, as well as the sqlite version. I guess it would take some time for the environmental variables to be fixed too. Thanks for letting me share this. Ted 18946_.zip
  5. thanks! I didn't realize it does conflict with the order by command in this case. I wish I had picked some other word.
  6. Hi, I am trying to get sql to work and inster by querying several statements thru php: INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('1', '1', '', '0', '0', 's1' , '3' , '1-2,2-4' , '' , '0', '0', '', '2009-05-27 23:37:38', '0000-00-00 00:00:00', '2' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('2', '1', '', '0', '0', 's4' , '3' , '1-2' , '' , '0', '0', '', '2009-05-13 23:40:51', '0000-00-00 00:00:00', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('9', '0', 'choui', '2147483647', '0', '' , '0' , '1-1,2-2' , '' , '5', '0', '0', '2009-06-01 14:11:59', '2009-06-06 01:55:03', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('6', '1', '', '0', '0', 'T1' , '0' , '1-1' , '' , '6', '0', '', '2009-06-01 09:20:51', '0000-00-00 00:00:00', '0' , 'yes! ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('5', '0', 'alibaba', '5204992222', '0', '' , '0' , '1-4,2-2' , '' , '0', '0', '0', '2009-06-01 09:19:13', '2009-06-06 01:55:44', '4' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('7', '1', '', '0', '0', 'T2' , '11' , '1-1,2-2' , '' , '5', '0', '', '2009-06-01 09:21:29', '2009-06-01 14:21:45', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('8', '0', 'ted', '0', '0', '' , '0' , '1-2,2-3' , '' , '0', '0', '', '2009-06-01 11:27:23', '0000-00-00 00:00:00', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('10', '1', '', '0', '0', 'S1' , '9' , '1-4' , '' , '0', '0', '', '2009-06-02 08:26:41', '0000-00-00 00:00:00', '3' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('11', '1', '', '0', '0', 'S1' , '9' , '1-4' , '' , '0', '0', '', '2009-06-02 08:26:41', '0000-00-00 00:00:00', '1' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('12', '1', '', '0', '0', 'S4' , '2' , '2-2,3-4' , '' , '5', '0', '', '2009-06-03 11:20:53', '0000-00-00 00:00:00', '2' , 'B-day coupon ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('13', '0', 'Ted', '52044923', '0', '' , '0' , '2-2' , '' , '3', '0', '0', '2009-06-04 13:09:08', '2009-06-06 01:44:38', '3' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('14', '1', '', '0', '0', '1/2' , '2' , '2-2,3-1' , '' , '5', '0', '0', '2009-06-05 20:44:26', '2009-06-05 22:18:43', '2' , 'B-day coupon ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('15', '1', '', '0', '0', 'T1' , '3' , '1-1' , '' , '10', '0', '1', '2009-06-05 22:36:21', '0000-00-00 00:00:00', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('16', '1', '', '0', '0', 'T1' , '3' , '2-2,3-1' , '' , '5', '0', '0,1', '2009-06-05 22:36:30', '2009-06-05 22:43:35', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('17', '1', '', '0', '0', 'T1' , '3' , '1-1,2-1,3-1,5-1' , '' , '10', '0', '0,3', '2009-06-05 22:36:38', '0000-00-00 00:00:00', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('18', '0', 'Test', '2147483647', '0', '' , '0' , '1-2' , '' , '0', '0', '0', '2009-06-06 01:46:05', '2009-06-06 01:50:43', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('19', '0', 'Ted', '9184881911', '0', '' , '0' , '1-2' , '' , '5', '0', '3', '2009-06-06 02:00:32', '0000-00-00 00:00:00', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('20', '1', '', '', '0', '2/1' , '5' , '2-2,3-3' , '' , '7', '0', '0', '2009-06-06 02:00:58', '0000-00-00 00:00:00', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('21', '1', '', '', '0', '3/4' , '5' , '2-4' , '' , '0', '0', '', '2009-06-06 02:01:16', '0000-00-00 00:00:00', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('22', '1', '', '', '0', '5/4' , '2' , '3-2' , '' , '0', '0', '', '2009-06-06 02:01:29', '0000-00-00 00:00:00', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('23', '0', 'ali', '1294109410', '0', '' , '0' , '1-2,2-3' , '' , '5', '0', '0', '2009-06-06 02:01:56', '0000-00-00 00:00:00', '4' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('24', '1', '', '', '0', '1/2' , '2' , '1-3' , '' , '5', '0', '0', '2009-06-06 18:00:30', '0000-00-00 00:00:00', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('25', '1', '', '', '0', '1/2' , '2' , '1-4,2-2,3-3,6-6' , '' , '5', '0', '0,1', '2009-06-06 18:06:07', '0000-00-00 00:00:00', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('26', '1', '', '', '0', '1/2' , '2' , '1-4,2-2,3-3,6-6' , '' , '5', '0', '3', '2009-06-06 18:06:22', '0000-00-00 00:00:00', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('27', '1', '', '', '0', '1/2' , '2' , '1-1,2-1,6-1' , '' , '5', '0', '2', '2009-06-06 18:08:16', '0000-00-00 00:00:00', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('28', '1', '', '', '2', '1/2' , '2' , '1-1,2-1,6-1' , '' , '5', '0', '1', '2009-06-06 18:13:39', '2009-06-07 22:59:57', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('29', '1', '', '', '0', '1/2' , '2' , '2-1' , '' , '5', '0', '0', '2009-06-06 18:14:12', '0000-00-00 00:00:00', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('30', '1', '', '', '0', '1/2' , '2' , '1-3' , '' , '5', '0', '0', '2009-06-06 18:14:38', '0000-00-00 00:00:00', '1' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('31', '1', '', '', '0', '1/2' , '2' , '6-4' , '' , '5', '0', '0', '2009-06-06 18:14:58', '0000-00-00 00:00:00', '5' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('32', '1', '', '', '0', '2/5' , '0' , '2-1' , '' , '0', '0', '', '2009-06-06 18:30:03', '2009-06-06 18:34:48', '1' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('33', '1', '', '', '0', '2/3' , '3' , '3-2' , '' , '0', '0', '', '2009-06-06 18:32:30', '0000-00-00 00:00:00', '4' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('34', '1', '', '', '0', '3/5' , '5' , '7-3' , '' , '0', '0', '', '2009-06-07 00:23:42', '2009-06-07 18:36:26', '3' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('35', '1', '', '', '0', '5/6' , '2' , '1-2,2-3' , '' , '0', '0', '', '2009-06-07 01:02:45', '0000-00-00 00:00:00', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('36', '1', '', '', '4', '5/6' , '2' , '1-2,2-3' , '' , '0', '0', '', '2009-06-07 01:05:30', '2009-06-07 18:48:45', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('37', '1', '', '', '0', '5/3' , '5' , '1-2,2-3,6-2' , '' , '0', '0', '', '2009-06-07 01:08:27', '0000-00-00 00:00:00', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('38', '1', '', '', '0', '5/3' , '5' , '1-2,2-3,6-2' , '' , '0', '0', '', '2009-06-07 01:15:58', '0000-00-00 00:00:00', '4' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('39', '1', '', '', '0', '1' , '2' , '1-1,2-2,7-6' , '' , '0', '0', '', '2009-06-07 16:02:30', '0000-00-00 00:00:00', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('40', '1', '', '', '0', '2/1' , '1' , '7-1,9-1' , '' , '0', '0', '', '2009-06-07 16:40:46', '0000-00-00 00:00:00', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('41', '1', '', '', '4', '2' , '1' , '7-1,9-1' , '1,3.95,Teds Dish' , '0', '0', '', '2009-06-07 16:44:44', '2009-06-08 01:55:20', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('42', '1', '', '', '0', '1' , '2' , '3-1,6-1,11-1,22-1' , '' , '0', '0', '', '2009-06-07 16:48:07', '0000-00-00 00:00:00', '0' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('43', '1', '', '', '3', '1/2' , '5' , '9-1,13-1,16-1' , '' , '0', '0', '', '2009-06-07 17:07:17', '2009-06-08 16:03:37', '1' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('44', '1', '', '', '3', '2/3' , '11' , '5-3,11-1' , '' , '0', '2', '', '2009-04-01 19:22:28', '2009-06-07 20:51:17', '1' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('45', '1', '', '', '3', '1/5' , '11' , '14-1,15-2,17-1,18-2,19-1' , '' , '0', '5', '', '2009-06-07 19:47:00', '2009-06-08 01:11:19', '3' , ' ' ) INSERT INTO order (id, type, name, phone, waiter, tableno, guestno, orders, specialorder, coupon, coupon1, couponcat, time, time1, paid, additional) VALUES ('46', '1', '', '', '5', '1/3' , '7' , '17-1,18-3' , '2,5.40,Chef' , '0', '5', '', '2009-06-08 13:22:01', '2009-06-08 16:12:12', '4' , ' ' ) the error comes out: Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 Warning: sqlite_query() [function.sqlite-query]: near "order": syntax error in /var/www/restaurant/backup/test.php on line 11 But the syntax error doesn't seem to reveal much, Thanks, Ted
  7. I think you should separate your sentence with comma before you try to nest your array with comma. Ted
  8. Hi, I will post the entire code up, this is my page, I cant spot any errors: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="../style/daleri-single.css" /> <title>File Explorer</title> </head> <body> <div id="wrap"> <h1><a href="index.html">NAS Home Page</a></h1> <p class="slogan">File Explorer</p> <p class="toptabs"> [color=red] <script language="JavaScript"> function setValue(value){ folderlist.folder.value = value; downloadfile.download.value = value; actions.folder.value = value; return true; } function ConfirmDownload(filename){ return confirm ('Download file ' + filename + ' ?'); } </script> [/color] <a class="toptab" href="../index.html">Home</a><span class="hide"> | </span> <a class="toptab" href="samba.cgi">Samba</a><span class="hide"> | </span> <a class="toptab" href="fileexplorer.cgi">File Manager</a><span class="hide"> | </span> <a class="toptab" href="cron.cgi">Cron Jobs</a><span class="hide"> | </span> <a class="toptab" href="lighttpd.cgi">Lighttpd</a><span class="hide"> | </span> <a class="toptab" href="mediaserver.cgi">Media Server</a><span class="hide"> | </span> </p> <div id="maincontent"> <div style="text-align:right;"><b style="float:left;">Current directory: /</b> <a onClick="setValue('extra.txt'); downloadfile.submit();" style="cursor:pointer;"><b>Move Up Directory</b></a> <a onClick="setValue('');folderlist.submit();" style="cursor:pointer;"><b>Refresh Current Directory</b></a></div> [color=red]<form id=folderlist name=folderlist action="/cgi-bin/smbclient.cgi" method="POST"> <pre><table> <tr><td><a onClick="setValue('/.');folderlist.submit();" style="cursor:pointer;"><img src="../style/fex/folder.png" /></a></td> <td style="width:270px"><a onClick="setValue('/.');folderlist.submit();" style="cursor:pointer;"><font color="black">.</font></a></td> <td> D 0 Sat Jul 17 15:56:42 2010</td></tr><tr><td><a onClick="setValue('/..');folderlist.submit();" style="cursor:pointer;"><img src="../style/fex/folder.png" /></a></td> <td style="width:270px"><a onClick="setValue('/..');folderlist.submit();" style="cursor:pointer;"><font color="black">..</font></a></td> <td> D 0 Sat Jul 17 15:56:42 2010</td></tr><tr><td><a onClick="javascript: if (ConfirmDownload('1.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><img src="../style/fex/txt.png" /></a></td> <td style="width:270px"><a onClick="javascript: if (ConfirmDownload('1.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><font color="black">1.txt</font></a></td> <td> A 127 Fri Aug 31 10:14:51 2007</td></tr><tr><td><a onClick="javascript: if (ConfirmDownload('2.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><img src="../style/fex/txt.png" /></a></td> <td style="width:270px"><a onClick="javascript: if (ConfirmDownload('2.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><font color="black">2.txt</font></a></td> <td> A 427 Wed Jun 25 12:41:44 2008</td></tr><tr><td><a onClick="javascript: if (ConfirmDownload('college.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><img src="../style/fex/txt.png" /></a></td> <td style="width:270px"><a onClick="javascript: if (ConfirmDownload('college.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><font color="black">college.txt</font></a></td> <td> A 2125 Sat Apr 28 17:52:02 2007</td></tr><tr><td><a onClick="javascript: if (ConfirmDownload('complaint.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><img src="../style/fex/txt.png" /></a></td> <td style="width:270px"><a onClick="javascript: if (ConfirmDownload('complaint.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><font color="black">complaint.txt</font></a></td> <td> A 371 Wed Aug 29 07:55:25 2007</td></tr><tr><td><a onClick="javascript: if (ConfirmDownload('extra.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><img src="../style/fex/txt.png" /></a></td> <td style="width:270px"><a onClick="javascript: if (ConfirmDownload('extra.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><font color="black">extra.txt</font></a></td> <td> A 1377 Thu Apr 3 11:51:33 2008</td></tr><tr><td><a onClick="javascript: if (ConfirmDownload('gash.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><img src="../style/fex/txt.png" /></a></td> <td style="width:270px"><a onClick="javascript: if (ConfirmDownload('gash.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><font color="black">gash.txt</font></a></td> <td> A 883 Sun Mar 30 10:57:42 2008</td></tr><tr><td><a onClick="javascript: if (ConfirmDownload('links.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><img src="../style/fex/txt.png" /></a></td> <td style="width:270px"><a onClick="javascript: if (ConfirmDownload('links.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><font color="black">links.txt</font></a></td> <td> A 1040 Tue May 15 07:56:39 2007</td></tr><tr><td><a onClick="javascript: if (ConfirmDownload('memory...txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><img src="../style/fex/txt.png" /></a></td> <td style="width:270px"><a onClick="javascript: if (ConfirmDownload('memory...txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><font color="black">memory...txt</font></a></td> <td> A 7279 Sun Aug 10 11:12:44 2008</td></tr><tr><td><a onClick="javascript: if (ConfirmDownload('question.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><img src="../style/fex/txt.png" /></a></td> <td style="width:270px"><a onClick="javascript: if (ConfirmDownload('question.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><font color="black">question.txt</font></a></td> <td> A 212 Fri Jul 4 19:46:29 2008</td></tr><tr><td><a onClick="javascript: if (ConfirmDownload('records.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><img src="../style/fex/txt.png" /></a></td> <td style="width:270px"><a onClick="javascript: if (ConfirmDownload('records.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><font color="black">records.txt</font></a></td> <td> A 923 Wed Jul 2 01:16:39 2008</td></tr><tr><td><a onClick="javascript: if (ConfirmDownload('records2.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><img src="../style/fex/txt.png" /></a></td> <td style="width:270px"><a onClick="javascript: if (ConfirmDownload('records2.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><font color="black">records2.txt</font></a></td> <td> A 6248 Tue Jul 29 23:09:39 2008</td></tr><tr><td><a onClick="javascript: if (ConfirmDownload('roommate.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><img src="../style/fex/txt.png" /></a></td> <td style="width:270px"><a onClick="javascript: if (ConfirmDownload('roommate.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><font color="black">roommate.txt</font></a></td> <td> A 1060 Sun Aug 3 02:12:56 2008</td></tr><tr><td><a onClick="javascript: if (ConfirmDownload('uni.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><img src="../style/fex/txt.png" /></a></td> <td style="width:270px"><a onClick="javascript: if (ConfirmDownload('uni.txt')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><font color="black">uni.txt</font></a></td> <td> A 292 Wed Jul 30 22:03:45 2008</td></tr><tr><td><a onClick="javascript: if (ConfirmDownload(' 59616 blocks o')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><img src="../style/fex/59616blockso.png" /></a></td> <td style="width:270px"><a onClick="javascript: if (ConfirmDownload(' 59616 blocks o')) {downloadfile.download.value = value; downloadfile.submit();}" style="cursor:pointer;"><font color="black"> 59616 blocks o</font></a></td> <td>f size 8388608. 37454 blocks available</td></tr></table></pre> <div style="margin: 20px 15px 10px 15px; text-align:center;"><i>There is no File in this Directory</i></div> <input type=hidden name=folder value="/"> </form> [/color] [color=red]<form id=downloadfile name=downloadfile action="test.php" method="POST"> <input type=hidden name=download value="/"> <input type=hidden name=submit value="submit"> </form> [/color] [color=red]<form id=actions name=actions action="/cgi-bin/smbclient.cgi" method="POST" enctype="multipart/form-data"> <input type=hidden name=folder value="/"> </form> [/color] <p class="bottomlinks"><a href="#">Bottom link 1</a> | <a href="#">Bottom link 2</a> | <a href="#">Bottom link 3</a> | <a href="#">Bottom link 4</a> | <a href="#">Bottom link 5</a> | <a href="#">Bottom link 6</a></p> </div> <p class="footer">Copyright © 2010 <a href="index.html">Ted Chou</a><br /> </div> </body> </html> Thanks,
  9. Hi, I am trying to get this submit a href but doesnt seem to work: <% if [ -z $OPEN ] ; then OPEN="[color=red]<a href=\"javascript: if (ConfirmDownload('$FILENAME')) {setValue('$FILENAME'); downloadfile.submit();}\" style=\"cursor:pointer;\">"[/color] fi %> <script language="JavaScript"> function setValue(value){ folderlist.folder.value = value; downloadfile.download.value = value; actions.folder.value = value; return true; } function ConfirmDownload(filename){ return confirm ('Download file ' + filename + ' ?'); } </script> <form id=downloadfile name=downloadfile action="test.php" method="POST"> <input type=hidden name=download value="<%= ${CURDIR:-/} %>"> [color=red]<input type=hidden name=submit value="submit">[/color] </form> When I tried pushing the submit button, it does try to load the post page, but using the a href does not. Thanks, Ted
  10. PHP only process information "after" you submit a page, or "before" you load a page. Only javascript allows dynamic page, so that is javascript, not PHP. If you right click on the search box, you can definitely see its flash. It might even be a bit difficult with javascript
  11. technically, since you are storing your information in a PHP file (please spell it correctly next time, I didnt catch what pho was until now). what you have GIVEN on the first post is ONLY INFORMATION not CODE. So PFMaBiSmAd is right, we shouldn't be writing code for you, especially ones that doesn't make sense, why would you try to store information in a formatted PHP file anyways, its just stupid? messing up the coding would just show it all out or result in PHP syntax. Now, consider about storing it in mysql or txt files? (text files can be locked in a dir that has .htaccess files which disable direct access from web browser, so it's secured in a sense.) Ted
  12. Yes, thanks. Thank you for the response. This isn't exactly what I'm looking for because the there isn't anything like a keyword_field. I basically have, item number and description in the database so I need the to match up '555%' with the word 'Chair' (and other numbers for other words). I've been using an if statement saying that is 'search' = chair then search for 555%. But I have close to 200 such statements to write. Well, if you post some of your codes, then we can help you, what are the names of your columns? Example of your query? if you don't give enough information, that's the amount of output you'd get, you can surely do a id search and a keyword search with the same keywords: SELECT * FROM table_name WHERE item_field LIKE '%{$_POST['search']}%' OR keyword_field LIKE '%{$_POST['search']}%'... Ted
  13. (PHP 5 >= 5.2.0) http://php.net/manual/en/function.filter-var.php <?php phpinfo(); ?> Ted
  14. I think your coding concept is not quite right seeing from the output, you are trying to add pages into the page number instead of displaying them on page. I have a pagination example, you might consider: //Set number of entries on each page: //max entries per page $limit = 3; //Query the database to get total entries: $news = file("admin/news.txt"); $totalrows = count($news); //Special Cases: $pagination = true; if ($totalrows == 0) {$pagination = false; echo "<p align=center><br /><br />$db_noentries</p>";} elseif ($news == false) {$pagination = false; echo "<p align=center><br /><br />$db_error</p>";} if ($pagination == true) { //Page variable set: if (isset($_GET['page'])) {$page = $_GET['page'];} else {$page = 1;} //Organize result details: $lines = file("admin/news.txt"); $lines = array_reverse($lines); //Set variables: $startvalue = ($page * $limit) - $limit; $numofpages = $totalrows / $limit; $totalpages = ceil($numofpages); if ($page == $totalpages) {$endvalue = $totalrows;} else {$endvalue = $startvalue + $limit;} //Start looping through the entries: while ($startvalue < $endvalue){ //Get general data: $data = explode(";seDp#", $lines[$startvalue]); //Perform organization: if (strlen($data[3]) > 500) {$extension = "...";} $entrycontent = "". substr($data[3], 0, 500) ."$extension"; $extension = ""; $textrcondition = 0; include("textreplacer.php"); //Get Replies: $replies = file("newscomments/comments[{$data[2]}].txt"); $total = count($replies); if (!file_exists("newscomments/comments[{$data[2]}].txt")){$total = 0;} echo "<a name=\"{$data[0]}\"></a> <h3>{$data[0]}</h3> <p>$entrycontent</p> <p class=\"post-footer align-right\"> <a href=\"news.php?news={$data[2]}\" class=\"readmore\">Read more</a> <a href=\"news.php?news={$data[2]}#comments\" class=\"comments\">Comments ($total)</a> <span class=\"date\">{$data[1]}</span> </p>" . "\r\n"; $startvalue ++;} //Starts page links: echo "<p align=center>"; //Sets link for first page: if ($page != 1) {$pageprev = $page - 1; echo "<a href=\"{$_SERVER['PHP_SELF']}?page=1\"><<</a> "; echo "<a href=\"{$_SERVER['PHP_SELF']}?page=$pageprev\">PREV </a> ";} else {echo "PREV ";} //Page Range sorting: if ($page <= 5) {$pagelowerlim = 1;} else { if ($totalpages <= 11) {$pagelowerlim = 1;} else {if (($totalpages - $page) < 5) {$pagelowerlim = $totalpages - 10;} else {$pagelowerlim = $page - 5;}}} if ($page <= 5) { if ($totalpages <= 11) {$pageupperlim = $totalpages;} else {$pageupperlim = 11;}} else {if (($totalpages - $page) >= 5) {$pageupperlim = $page + 5;} else {$pageupperlim = $totalpages;}} //Looping through page numbers: $i = $pagelowerlim; while ($i <= $pageupperlim) { if ($i == $page) {echo "[$i] ";} else {echo "<a href=\"{$_SERVER['PHP_SELF']}?page=$i\">$i</a> ";} $i ++;} //Set link for last page: if ($page != $totalpages) {$pagenext = $page + 1; echo "<a href=\"{$_SERVER['PHP_SELF']}?page=$pagenext\">NEXT </a> "; echo "<a href=\"{$_SERVER['PHP_SELF']}?page=$totalpages\">>></a>";} else {echo "NEXT ";} echo "</p>";} This gives PREV [1] 2 3 NEXT >>...etc you can click on, I modified it a bit so it only outputs 11 pages on the page if number of pages exceed 11. Ted
  15. Thats the correct output, if you want to separate them you HAVE to use html code: $form_submission = "brother"; $lines = file('eo_dic.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); if ($form_submission == null){ // Sanitization. echo 'Text field is empty!'; exit; } foreach ($lines as $line) { list($field1, $field2) = explode('=', $line); // back slash might not be needed if (stristr($field1, $form_submission) || stristr($field2, $form_submission)){ echo $field1 . ' = ' . $field2 . '<br />';//NEED tO USE HTML CODE } }
×
×
  • 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.