Jump to content

jimfog

Members
  • Posts

    1,803
  • Joined

  • Last visited

Everything posted by jimfog

  1. yes you are right...when you mentioned about testing test.html.php....at that point I Misunderstood. So,now here we are...I hope we can get a solution here.
  2. let me clarify some things.... the redirect command is NOT from you....I found it in the web to make some testing. and inside the htaccess file it is only this and ONLY this...I have removed your code. Are we OK now? As I said it is for testing purposes...and later on I will examine the rewrite case.
  3. this is the latest iteration: RewriteBase /Appointments/Frontend/ Redirect 301 /test.html /test.php no redirection takes place...and yes I cleared the browser cache.
  4. One by one: I know that the redirect has nothing to do mod_rewrite...I do not mix them...here is the file as we speak: RewriteBase /Appointments/Frontend/ Redirect 301 /blog_dtl/genga.php http://www.example.org/newpage.html You mean I should clear the browser cache?You are right I did not try that. I suppose browser history will be gone... confirm this please before continuing
  5. here is my htaccess file after modifying it according to the above. RewriteBase /Appointments/Frontend/ Redirect 301 /blog_dtl/genga.php http://www.example.org/newpage.html Still nothing....no redirection takes place.
  6. I cannot make .htaccess work...inside it I have placed this redirection syntax Redirect 301 /genga.php http://www.example.org/newpage.html this is the link I click http://localhost/Appointments/Frontend/blog_dtl/genga.php And here is the dir structure where I indicate the folder where this .htaccess is located https://onedrive.live.com/redir?resid=BE27434B2AAC8130!454&authkey=!AO71ww8Tkksk6hc&v=3&ithint=photo%2cPNG I always restart Apache... I do not know what is wrong....
  7. to which PHP file are you referring to...test.php
  8. before continuing and testing the code I want to know where I should place .htaccess? Inside htdocs or inside the project folder(which is inside htdocs)?
  9. I am going to ask again...so I can have it clear in my mind. The link in the HTML file is it going to be dirty? If the user views the source of the file what URL will be there...forger mod_rewrite for a second and what is displayed in the address bar. You are describing me the end result....before reaching there I am trying to understand it step by step. And if you are wondering why I am insisting so much take a look at the read more links here https://taxibeat.com/blog/
  10. I suppose you mean that the issue now is for a different topic.
  11. I do not use a CMS so the idea of a plugin is not suitable here. regarding mod_rewrite... I do not know how to use it...especially in this case. For example...the link in the HTML file(that the user will click) is it going to be in the user-friendly form and then transformed to the "dirty" form by mod_rewrite? I do not want to go further...answer this for now.
  12. so...you are saying that the retrieval of the article from the database is based on this unique-identified. Are you assuming this is the case or you know it?
  13. I do not quite understand what do you mean with the above
  14. I have observed that read more links of blog articles in Wordpress have this user friendly form: https://domain.gr/2016/04/26/easter-holidays/ For the date part I am not sure...probably it is optional I do not use Wordpress....I make a custom blog and I want my read more links to have the same form. How am I going to achieve this? Furthermore I do not see some kind of ID in the url that will aid in retrieving the article from the Database. So there is this issue too. The only thing that I can think of is that the title of the article is used to retrieve the article from the database. What do you think?
  15. I have these 2 files: file1.php namespace names; function t() { echo 'john'; } file2.php use names; header('Content-type: text/plain'); echo t(); so.I try to run file2.php and here is what I get: <br /> <b>Warning</b>: The use statement with non-compound name 'names' has no effect in <b>C:\Apache24\htdocs\Appointments\nm_spacetest\file2.php</b> on line <b>2</b><br /> <br /> <b>Fatal error</b>: Call to undefined function t() in <b>C:\Apache24\htdocs\Appointments\nm_spacetest\file2.php</b> on line <b>5</b><br /> What am I doing wrong...I first import the namespace and then try to run the code that is "registered" to it.
  16. Exactly....the data is small enough so as to justify such a decision-to download all the data.
  17. I do not think pagination will be needed here since 2-5 services(for now) must be shown to the user....not much data. So...assuming no pagination, you suggest that I download the data with PHP after all? And hide it of course till the user "asks" them of course...
  18. I am building a web app where the user has the option of storing favorites business users where each one of them offers some services. These services must be seen but the user...whenever he/she clicks on one of the favorites business user. Here is the question: What do you think it is better....prefetch the services with PHP, hide them and make them visible when the user "asks" for them or bring them with ajax the moment the user "asks" them. P.S when I say asks them...I mean a user action such as clicking a button...
  19. I do realize that and this is what I want...sorry if I was not able to make it clear from the beginning.
  20. The above code seems to do the job...thanks.
  21. Exactly...the user must not have the option selecting 15:00...that is why I must remove it from the array.
  22. This kind of task, though, seems ideal for a database to do rather than putting the work on PHP. Databases are highly optimized for searching and manipulating data like this. First of all....the array you see above is taken out of a database...either way. To understand better: All these times/days you see represent the schedule of a business(hair salon for example)...ex.Friday, from 10:00-15:00. From this schedule the available appointments slots are shown to the user...which of course must fall within this time frame. The only problem is that the last time must not be shown to the user since at that time the store closes and it is not considered an available time-slot. That is why I want to remove the last time segment from each day....I have not found a way to do it in the DB level(with a query)...as such I am trying to do it using application code.
  23. I have a multidimensional array...it goes like this: array(112) { [0]=> array(4) { ["title"]=> string(8) "11:00:00" ["day"]=> string(6) "friday" ["date"]=> string(10) "2015-12-04" ["time"]=> string(8) "11:00:00" } [1]=> array(4) { ["title"]=> string(8) "11:30:00" ["day"]=> string(6) "friday" ["date"]=> string(10) "2015-12-04" ["time"]=> string(8) "11:30:00" } [2]=> array(4) { ["title"]=> string(8) "12:00:00" ["day"]=> string(6) "friday" ["date"]=> string(10) "2015-12-04" ["time"]=> string(8) "12:00:00" } [3]=> array(4) { ["title"]=> string(8) "12:30:00" ["day"]=> string(6) "friday" ["date"]=> string(10) "2015-12-04" ["time"]=> string(8) "12:30:00" } [4]=> array(4) { ["title"]=> string(8) "09:00:00" ["day"]=> string(6) "monday" ["date"]=> string(10) "2015-12-07" ["time"]=> string(8) "09:00:00" } it lists the weekdays covering an entire month...every day corresponding to a date and for title I have times(I know this is misleading but I cannot explain now the story behind it) The goal: For each weekday I want to delete the last array member Let me explain: In the example above Friday is mentioned for times 11:00...11:30...12:00...12:30...I just want to delete the array member for 12:30....leaving times 11:00...11:30....12:00. It has to be a loop..but apart from that I do not know how to proceed....
  24. yes...inner join was the solution after all....nonetheless there is something else yet This INNER JOIN gives me the available booking slots for a hair salon(for example)-since I am making an appointments app. I must also add the criteria to exclude the already booked appointments stored in this table: CREATE TABLE `appointments` ( `apID` int(11) unsigned NOT NULL AUTO_INCREMENT, `Bookfrom` varchar(45) DEFAULT NULL `bookedfor` mediumint(11) unsigned DEFAULT NULL `appont_close_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `startDate` date NOT NULL, `startime` time NOT NULL, `endDate` date NOT NULL, `endTime` time NOT NULL, `apps_origin` enum('frontend','backend') NOT NULL, `staffID` int(11) unsigned DEFAULT NULL, `deleted` tinyint(1) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`apID`), KEY `fk_appointments_user1_idx` (`Bookfrom`), KEY `bokkedfor` (`bookedfor`), KEY `fk_appointments_staff1_idx` (`staffID`) ) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8 I think here we need a LEFT JOIN with the result of the inner join. I can perform LEFT JOIN between the avai_apps table and(have already done that) the appointments table....but I am stuck in performing a left join between the result of the above INNER JOIN and the appointments table so that I can get the available timeslots that will take into account the schedule and the already booked app. Thanks
  25. can you give me an example of how I could accomplish my goal...using LEFT or RIGHT join. What interests me more though is finding out which columns must be NULL in this case...this is what troubles most.
×
×
  • Create New...