Auto Changing Link Depending On Date
I want to have a special link on my site.
The link is to a text file located on a distributor's website and is named with a specific filename in the same format every week. In other words it's guaranteed predictable.
Here is what the file would look like,
shipping_032107.txt
which means,
shipping_(month)(day)(year).txt
How could I use something to make the link the right name without modifying my page weekly? The one tricky part is that it's updated once a week and it would be Wednesdays date each time. So it actually has to predict the next date. Perhaps if the script couldn't do that it could figure out todays date, check it to the days of the week and add a number to equal the proper day, I have no idea what to start with for this.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Drop Down Lists Changing Depending On Other Drop Downs
I want to have a drop down system like this one. But without the radio buttons. I want to have 3 drop downs but have no idea how to go about it. I assume I will need to activate some sort of Javascript on the onChange event of the option drop downs.
Changing A More Link Into Page Numbers
I have the following code which I've tried to edit to fit some examples others have posted on here, with no luck. I have a page that displays More and Prev links but not the page numbers. How can I change this code to have page numbers instead of the More Prev? PHP Code:
Changing Variable String Value On A Link Click
Hi... I'm trying to change the value of my $cat variable when someone clicks on a link that consists of an image and some next I'm not sure how to do this... but I think I need some javascript as well so if $cat="Main" and a certain link is clicked I want $cat="Something else"
Changing Date?
In MySQL database the date format is as follows: YYYY-MM-DD But how can I make it so that when I see it on the page it will be as follows, which is English format: DD-MM-YYYY
Changing Date Format
If I fetch a date from a mysql field and the date is: 2006-01-12 00:00:00 Is there a way I can reformat it in php to lose the hr.min.sec so that I am just left with the date 2006-01-12??
Changing Items After A Date
What I have is a table (code below) and it is for an events page. What I want is after the date has gone, it changes the whole row to grey. ( #666666 ). Code:
Changing Date Format
i hve a date variable in mm-dd-yyyy format how can i change it to mysql default format i.e., yyyy-mm-dd format ...
Stoping Auto Updates Of The Date Field
I have a table with a field using the "timestamp" type. When I update another field, the "timestamp" field also updates to the time the other field was updated. I don't want this. I'm using this to update the table. PHP Code:
Auto Delete Date Based Calendar Events
Out of both wanting to improve my PHP skills and necessity, I created my own small CMS for a non-profit site I am involved with. One of the features I have is an event calendar where other users can submit events, which then go into a "holding tank" until I can approve or deleted them. It's working great and everyone is loving it... but I have discovered one issue. When the date of the event passes, I have to log into the admin area and manually remove it. I am actually not deleting it from the database but changing a field variable and archiving it for our records. I have been trying the past few days to come up with the necessary PHP to automatically check the current date (today's date) against all the calendar events and remove ones that have already happened. I could then hook this up to a CHRON action in my hosting CPanel and call it a day - at least that is how it all plays out in my head. I imagine in order to point me in the right direction you will need some information about my database.
Check Date And Time And Display A Link Between Certain Hours
I need to write a PHP script that can check the date and time, and if it falls in between certain hours to display a link, and if not display another link. The application is for a realaudio broadcast which goes live 7-9pm every wednesday. If it's not "live" then the link would be to the archive from the previous show.
Dynamic Download Link - Not Direct File Link
I'm posting a podcast feed that makes reference to audio files for download. Instead of linking to the files directly (e.g. www.mywebsite.com/podcast.mp3), I want to link to the file as get variables so that I can track number of listeners (e.g. www.mywebsite.com/?audio=podcast.mp3). Where would I look to get something like this to work? How do I start sending audio data to the user using a link like this?
Depending Checkboxes
I have one MySQL table from where I pick project names and then list them in a combo box (menu). Depending on what project a user would pick he would then pick a task, that exists in that project (another table for projects). Concept is quite simple but very hard to implement since internet is stateless. The simplest way would be to pick a project from the first combo box. Depending on what project I would pick the content of task combo box would be adapted. Maybe this could be done with javascript but I don't know how. Maybe I should forget this concept and do it with step by step picking. New page for each pick.
If Statement Depending On Domain?
I've got webspace with multiple domains pointing to it. Domain A points to one directory. Domain B points to another directory. I've got identical sites running in each directory and I'd like them to remain identical. However, some links need to change depending on which directory they are in. I don't to manually change these links every time I make an update. What argument would I use in an if statement?
$http_response_header Differs Depending On OS
I'm making a HTTP request to a source where I get redirected. Let's assume this page is "https://www.example.com" and it redirects me to "https://www.example.com/redirect.html". My request looks like this: $html = file_get_contents('https://www.example.com'); Now, when I print out $http_response_headers I get different output on MacOS/Linux and Windows: MacOS/Linux: HTTP/1.1 302 Found Connection: close Date: Mon, 26 Feb 2007 15:28:46 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Location: /redirect.html Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 266 HTTP/1.1 200 OK Connection: close Date: Mon, 26 Feb 2007 15:28:46 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 7830 Windows: HTTP/1.1 200 OK Connection: close Date: Mon, 26 Feb 2007 15:28:46 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 7830 So on Windows I only get the header of the last page I was redirected to. But I need all the headers on Windows. Does anybody know which setting is responsible for that? In both cases (MacOS 10.4 and Windows XP SP2) I am using the latest XAMPP.
$http_response_header Differs Depending On OS
I'm making a HTTP request to a source where I get redirected. Let's assume this page is "https://www.example.com" and it redirects me to "https://www.example.com/redirect.html". My request looks like this: $html = file_get_contents('https://www.example.com'); Now, when I print out $http_response_headers I get different output on MacOS/Linux and Windows: MacOS/Linux: HTTP/1.1 302 Found Connection: close Date: Mon, 26 Feb 2007 15:28:46 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Location: /redirect.html Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 266 HTTP/1.1 200 OK Connection: close Date: Mon, 26 Feb 2007 15:28:46 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 7830 Windows: HTTP/1.1 200 OK Connection: close Date: Mon, 26 Feb 2007 15:28:46 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 7830 So on Windows I only get the header of the last page I was redirected to. But I need all the headers on Windows. Does anybody know which setting is responsible for that? In both cases (MacOS 10.4 and Windows XP SP2) I am using the latest XAMPP.
Display Image Depending On Url
I am a complete newby to php and Im trying to learn how to do something, here is what im trying to achieve. something like: if url="page1.php" then print("<img src="image1.gif" alt="image1">"); if url="page2.php" then print("<img src="image2.gif" alt="image2">"); if url="page3.php" then print("<img src="image3.gif" alt="image3">"); I know its wrong but you get the idea. Ive searched around google etc for some kind of example but I can't find anything, can anyone help me go in the right direction?
PHP Login - Redirects Depending On User
I am trying set up user authentication using PHP. My biggest goal is this: When a user enters in thier user name and pass they will be redirected to a specific page. The redirect page willl be different for every user. How do i do this redirect thing?
Different Graphic Displayed Depending On Host
I know that you can display the host name in PHP using <? echo $HTTP_HOST; ?>, but how can you display a different text and a different image depending on the host the page is called from?
Show Page Depending On Request Url?
Is there any way to show a different page depending on the request url? I have a few domains that point to one IP address. What I want to do is if someone requests http://www.site1.co.uk they see site1.php or http://www.site2.co.uk they see site2.php etc all from the root directory? I do not have httpd.conf access Is this possible?
Get The Info Depending On The Selected Option
I have a page that is intendend to update a table field on DB i have a drop down menu wich displays all the position fields available on db and a text area where i will insert the new data. now the problem: I'm using the query SELECT * FROM table WHERE position = $position the $position is the choosen option from the drop down menu. then have echo "<textarea>$functions</textarea>" where it will show to me the present data available on DB after all this, i have another query UPDATE table SET functions = $functions WHERE position = $position All is ok and working except the fact that he doesn't displays $functions when selecting a option from the drop down menu?
Partitioning The Program Depending Upon Browser
I am developing a site, and here whats the problem is: how to partition the code, i.e. if I developed 1000 lines of code, in that I want to show first 200 lines only if the user opens my website using IE, and next 200 lines in Firefox, and remaining lines in another browsers. Here am asking that how to compatible the total code depending upon the browsers used by users.
Getting Page Referer Without Depending On User
I NEED the page referer for a script i've built to work, basicly i'm redirecting to my frames page with a line like this.. if ($m == "find") { $mainframe = $_SERVER['HTTP_REFERER']; } but i've been told that this data is sent from the user, so i need some way of telling my script which page to use as the main frame.
Sending An Email Depending On Drop Down
I'm trying to create a form with two drop down menus, (both populated from mysql databases). One of the databases has user names in it. The other has managers in it + their email addresses. The idea is that the user chooses their name and the name of the manager they will be working for and it then sends an email to the relevant manager telling them that the user's name and what time they have logged on. I've worked out how to populate the drop down menus from the database, and how to send the time and name via email. Unfortunately I haven't worked out how to tie them together or how to send to the different email addresses. I've been staring at the code so long it now looks like gibberish. Code:
Language Depending Item Url's
I'm using a little newsflash item on my webpage, which is some text in an iframe. I have one newsflash item in English and one in another language, newsflash-english.html and newsflash-other.html How can I serve newsflash-english.html to english surfers and newsflash-other.html to not english users ? depending on the browser language ?
Create Listbox Depending On Variable
I currently have a variable called $NumPlayers which contains a number between 4 and 8; depending on this value; i would like to create this amount of listboxes on my page. For example if the value of $NumPlayers is 6; I would like 6 listboxes to be displayed on the page with names such as "Lstbox1" "Lstbox2". I'm a bit clueless where to start; and was hoping someone could point me in the right direction.
Display A Certain Image, Depending On A Variable.
I have a database with the following information in. User ID, Username, Country, City. I have created a page which lists all of the users and their cities and would like to add the flag of the user's country next to their name. How would I do this? I understand I could go with if statements (e.g. if $country = eng display englishflag.gif elseif $country = scot display scotishflag.gif) however with so many countries this would take forever and far too much code. Is there any easier way of doing this?
Change Text Depending On Time Of Day.
I have seen on some websites that text and images change depending on the time of day, a bit like a tv schedule where it shows whats on now and then in an hour it changes, does anyone know a script or tutorial that has something like this?
Filling An Array Depending On A Variable
I want to fill an array with numbers depending on a variable. On the page for holiday booking, the user gives the date of arrival and the date of departure, now i have written code to determine the number of days the user is staying. Say this is 5, now i want to fill a variable with the numbers 1,2,3,4,5 If the user stays 3 days the variable should be filled with 1,2,3 I came up with this ....
Array Sorting Differs Depending On PHP Version
I have this test code: <html><pre><? echo "Versión: ".phpversion()." "; $define_list = array( 'PRODUCT_LIST_MODEL' => 0, 'PRODUCT_LIST_NAME' => 0, 'PRODUCT_LIST_MANUFACTURER' => 1, 'PRODUCT_LIST_PRICE' => 0, 'PRODUCT_LIST_QUANTITY' => 1, 'PRODUCT_LIST_WEIGHT' => 1, 'PRODUCT_LIST_IMAGE' => 1, 'PRODUCT_LIST_BUY_NOW' => 1 ); arsort($define_list); echo "*** arsort(): "; print_r($define_list); echo " "; $define_list = array( 'PRODUCT_LIST_MODEL' => 0, 'PRODUCT_LIST_NAME' => 0, 'PRODUCT_LIST_MANUFACTURER' => 1, 'PRODUCT_LIST_PRICE' => 0, 'PRODUCT_LIST_QUANTITY' => 1, 'PRODUCT_LIST_WEIGHT' => 1, 'PRODUCT_LIST_IMAGE' => 1, 'PRODUCT_LIST_BUY_NOW' => 1 ); asort($define_list); echo "*** asort(): "; print_r($define_list); echo " ";
Using Custom SQL Functions To Call Either Ms... Or My... Depending On Server
As I'm developing my site, i've come across a problem with the database use. While developing it I only have mySQL, but the final server has msSQL. I was thinking about using all my own functions (ie sql_query), which would be a function in an include file which would either call mysql_query or mssql_query depending on the server (i'd have two different include files for this). Has anyone done this before, do you know of any drawbacks, or are there any problems i'm likely to come across? I'm hoping speed won't be an issue, since its just calling a function which does the exact same job. Heres what I had in mind: ####### in the main file ######### $query = "SELECT * FROM ....."; $result = sql_query($query); $num = sql_num_rows($result); ########################### ##### include file, for mysql ###### function sql_query($sqlquery) { $result = mysql_query($sqlquery); return $result; } function sql_num_rows($sqlresult) { $num = mysql_num_rows($sqlresult); return $num; } ##############################
Having A Form Submit To A Different Place Depending On A Variable..
I am trying to have a form submit to another source depending on a certain variable. Only problem is that the variable is not defined untill after you submit the form. Basically if a certain text field in the form is left blank i want it to be posting to a different place.
Php Questionnaire That Delivers Answers Depending On The Responses
I am trying to build a questionnaire that once submitted returns a page that will provide answers and products dependent on wha the response of the individual is. does my form have to be a get rather than post (im presuming it does). and how do i sort the conditions so that if one answer is selected it writes a unique response?
Best Way To Change Values Of Fields Depending On Page Function.
I have at the moment a create_user.php and edit_user.php they are the same, create has <input type="text" value="" name="xx"> for a field, and edit has <input type="text" value="<?=$row['rowhere']?>" name="xx"> - I would much rather have just the one page where if page function was edit then it calls in the row otherwise leaves value blank. How can I do this other than if ($pagefunction == "create") { echo "<input type="text" value="" name="xx">"; } elseif ($pagefunction == "edit") { <input type="text" value="<?=$row['rowhere']?>" name="xx"> } on every field!?
Dynamic Fill Form Fields Depending On Dropdown Box
This question has probably already been asked, but let me ask again I have a mysql database to which I connect with my php scripts. The database contains articles. Name, Unit_Price and Reference Now my client needs to order 5 items, click a button and a table with 5 lines and 3 columns appears (until now easy) In the first column is a drop down box with a <select > and <options> in which I store all possible names. I would like than whenever the client changes one of the boxes (in my case there are 5) the Unite_Price column and Reference column in the line he just choose get automatically updated
Reading A Log File One Line At A Time Depending On Timestamp
Currently I am attepting to create a stats package for my companies website (yes my life would be 100% stress free if I was allowed to use a standard/commercial stats package ). So far things are all good, and ive progressed quite far. But ive hit a snag. At the moment im reading in the WHOLE log file and sorting it into an array and passing the neccesary data to mysql. Easy peasy. But my boss has pointed out to me that as the site gets more and more traffic the log gets bigger, and if it gets to big the servers memory will overload, and we all know what happens then! So what I need to do is read in the file one line at a time. and compare the timestamp to the last time the script was run. If the timestamp in the log is less than the last timestamp for when the file was run dont read it. If it is more than defiently read it. Code:
Determine If User Came From Inner Link Or An Outside Link
any php method or function to determine if a user came from within the website or from an outside website. I have a page that I want to display in different manners depends on how did the user arrive at my site. I know about the HTTP_REFERER function. but don't really know how to use it. I know this is the syntax: <?php echo $_SERVER['HTTP_REFERER']; ?> but when i entered the code in the php page. for instance test.php, there is nothing coming up. So my questions: 1. is there any other method? 2. could any of you maybe specify a bit more details about this function and how to use it.
Insert/Remove Portion Of Query Depending On Form Field
I have a form that updates an employee's information including a password for that employee. The form has a password field and what I would like is if the admin leaves that field empty, the users password remains unchanged in the database... but if the admin enters text into the password field then that text should update the database as the employees new password. The problem is to do this I need to either insert or remove a portion of the sql query. (There's probably an easier way to do this that I'm not seeing at 5:30AM.) But I don't know how to store the query portion outside of the actual query and then insert it when needed. So let's say this is the basic query. This is what I want if the password FORM field is EMPTY: ....
Check Date From Input Must Greater Or Equal Today Date?
I have 3 select box. Code: <select name="day"> <option value="1">1</option> <option value="2">2</option> ....... <option value="31">31</option> </select> <select name="month"> <option value="01"> Jan </option> <option value="02"> Feb </option> ..... </select> <select name="year"> <option value="2002">2002 </option> <option value="2003">2003</option> </select> When I select and click submit in form. I will have 3 variable : $day, $month and $year How can I check the day that I choose in form must equal or greater than today date? If it less than today date. I must print error message to user.
Date Is Not Being Pulled From MYSQL Database, Instead Current Date Is Displayed!
I am having trouble pulling a date from a database using PHP at the <a href="http://www.mytuneslive.com/ameshkin69/"> following page.</a> Here is the code. As you can see, it is just making the date the current time. The values in the database are UNIX timestamp, and the DATE() function is used to convert from UNIX to readable date. Can <td width="55%" align="left" valign="top"><?php $row_comment['timestamp'] = date("n d Y g:i A");.....
Auto-Tab
I have a page that has 5 input boxes, the first box holds 5 characters, the second holds 4 and carries on varying in length. I need to find a way so that when a user enters the 5th char in the first box, then the cursor moves to the second box and so on...
Read Today's Date Print Tomorrow's Date
I've got a small script that writes a random number and the date to a text file. Then the script opens this text file and if date = date from this text file something must happen. If something happened this script must open this text file again and replace it with a new random number and tomorrow's date. <?php $date = date("d-m-Y"); mt_srand((double)microtime()*10000000000); $num=mt_rand(0, 20); if ($num == $num && $date == "$tomorrowdate") { echo"$num -- $date";} else echo " ";?> So if the script gets activated on the 05-05-2003 it must write tomorrow's date into the text file (06-05-2003). How will I get tomorrow's date today?
Help: Date Function Not Returning Correct Date & Time
I have just notices that the date() function is not returning the correct date/time on my "server". I am running apache2 on my winxp pro laptop. My system clock is set to the correct date, time and timezone, get the results returned by date() are 11 hours behind.
PHP Date Question: How To Determine The Date Each Of The Past 3 Sundays
How can I determine what the date was (in YYYY-MM-DD format) last Sunday, and the Sunday before that? For example: Today is Thursday, August 18, 2004 (2004-08-18). I would like to have the following variables: $this_past_sunday = 2004-08-14 $two_sundays_ago = 2004-08-07 $three_sundays_ago = 2004-07-31 etc. etc.
Save Date To Table Field Date Type
I have a calendar picker on a form that fills a text box with XX/XX/XXXX date format. If I run a insert statement the date field in the database shows 0000-00-00. If i change the field type to varchar the correct format displays. What is the correct way to save a date to a mysql database? Furthermore to query on the date how about a select * from db_name where servicedate >= $startdate and servicedate >= $enddate I supose this will not work Any pointers?
Auto Variable
Say I have fetched these from my mysql database: 13 14 23 39 80 How do I make them assigned into an automatic variable?
|