LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-10-2004, 02:43 PM   #1
ghight
Member
 
Registered: Jan 2003
Location: Indiana
Distribution: Centos, RedHat Enterprise, Slackware
Posts: 524

Rep: Reputation: 30
PHP $_GET is getting weird info


I'm using a PHP calendaring program and editing it to the job I need. It's called Datenator version .22. My issue with the statement below:

Code:
// Delete event
if(isset($_GET['delete'])) {
	$s_month = $_GET[month];
	$s_year = $_GET[year];
	$sql = "DELETE FROM ".$tablepre."Events WHERE ID='".$_GET['delete']."'";
	mysql_query($sql) or die(mysql_error());
	header('Location: a_events.php?month='.$s_month.'&year='.$s_year.'&a=1');
The page in question lists events that can be edited. This code is supposed to show the current page minus the deleted event. It does so by getting the YEAR and MONTH that was posted to the page from the previous page. Say I'm looking at Sept 2004, then delete an event. Once I delete an event it should go back to the listing for Sept 2004 with the updated list. Instead the $_GET ALWAYS grabs November 2003! This make no sense to me. Why would it always grab this date even though my server date is correct and it is not specifically assigned this date anywhere? Any ideas? The month and year are posted when the month to edit is chosen so it should be correct.

TIA
 
Old 08-10-2004, 02:50 PM   #2
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
The error is not here but in the calling script I think.
 
Old 08-11-2004, 12:32 PM   #3
id10t
Member
 
Registered: Dec 2003
Location: Minnesota
Distribution: Slackware 9.1
Posts: 63

Rep: Reputation: 15
I'm not sure what your level of understanding is, so I am going to post this as if you knew less than I do.

Can you see what the URL is when this script is called. Because of the way that GET variables work, you can see both their names and values in the URL itself.

I am guessing the URL is something like "<scriptname>.php?month=9&year=2003&delete=<some number>"
or "<scriptname>.php?month=november&year=2003&delete=<some number>"

This URL is generated by the script that refers to the script that you pulled the code from.

What I would suggest doing is looking to the script before for the error. I am not sure whow each day in the calendar is listed on, but I would imagine each one has it's own events with a link to delete... Correct? Look at where that link is created and I bet you will find "November" "2003" hardcoded in. If you don't and you actually do find a variables there, I would follow those variables back to where they are given their value.

Hope this helps... Good luck. (Oh and sorry if my spelling or grammar is lame... I'm still working on this "english" thing)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot See info.php in Apache 1.3.33 Slack 10 grimlaur Slackware 3 02-05-2005 03:27 PM
changing php info variables?? vickr1z Linux - Newbie 1 10-26-2004 10:16 AM
why fsockopen() use root dns info?? - about php chtla Linux - Software 0 04-13-2004 11:42 PM
net info in php punker22 Programming 0 02-18-2004 10:36 PM
Can you use $_GET & $_POST on the same page? patpawlowski Programming 3 02-05-2004 05:24 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration