Skip to content

Detect the right name in string

So I was wondering how to detect the right files, by their names, when I scan through them. Right now when I open a pop-up window, I GET a id (?id=2451961), and this id is used to detect image files in a folder. But how should i detect them? Is there a way to say, the start of the files

Calling class method in jquery

Hey im trying to build a simple inventory program. I have class like this : now i want to append rows in my table which contain select option like this: but new row wont added if call my class using normal php line. It does however add a new row if i remove the php line. So, how can i

Add domain to src attribute value if a relative path

I have a text variable which contains multiple images with a relative or absolute path. I need to check if the src attribute starts with http or https then ignore it, but in case it starts with / or something like abc/ then prepend a base url. I tried like below: My output is: Issue here: I got 99% result

Order mySQL query by year with several year specifications

I am using this query to pull out article entries from my database: With single year specifications, the query orders the entries by year as intended: Problematic is that this older database uses several publishing years in the same table cell, looking like this: Example: 1970, 1974, 1983 or sometimes with se…

Error when using “parse_str” … Undefined index: query

I am trying to get the current page URL, which may look something like this: http://www.example.com/login.php/?redirect=myprofile.php …and then get everything after the “redirect”. Here is my code so far: However, I keep getting an error if the index query does not exists in the array: Notic…

How to process insane date inputs with php

I have a code in php for processing the personal details of a person. I need code to handle the date input such that when the user inputs a year like 1900 and below then the program outputs That is impossible. I have successfully handled how the program should respond if the date input is in the future. The p…