Tutorials
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOtherTutorials

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #1  
Old December 17th, 2003, 01:02 AM
sapac sapac is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Adelaide,SA,Australia
Posts: 9 sapac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
REQUEST: News tutorial

Hey,

Im having some trouble completing the news tutorial posted by Matt.

Seems stupid really considering all you have to do is copy the code....

But, im up to the part where im tryin to add the option to delete a particular news item.

Everything was going well until i realised that when i click on the link 'Delete' it does not enter the 'if' statement:
if($action=="delete"){....}

However, the url changes to http://server/php/news.php?action=delete&id=7
so im guessing that the variable $action does get set correctly on the server side...

Is the $action variable global and everlasting as such....i.e. does it at any point get reset or change value...??

I would appreciate any and all feedback that can be given.

Cheers,

Luke

Reply With Quote
  #2  
Old December 17th, 2003, 01:39 AM
sliver's Avatar
sliver sliver is offline
Moderator
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: WI, USA
Posts: 881 sliver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 h 27 m 27 sec
Reputation Power: 2
Send a message via AIM to sliver Send a message via XFire to sliver
RE: News tutorial

At the beginning of the script add this:
php Code:
Original - php Code
  1.  
  2. $action=$_GET['action']

and see if it works. Or you can open ur php.ini, and turn on register_globals.

Reply With Quote
  #3  
Old December 17th, 2003, 02:56 AM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 23 sec
Reputation Power: 6
RE: News tutorial

Yep...it most likely is that you have register_globals off on your server. I need to update some of the tutorials to work with register_globals off...

Reply With Quote
  #4  
Old December 17th, 2003, 03:29 AM
sapac sapac is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Adelaide,SA,Australia
Posts: 9 sapac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: REQUEST: News tutorial

Me again,

Yes, that worked....i do have register_globals turned off as i read somewhere that in general it is more secure....?? True?

Anyway, im still having trouble with this one....

Now when i go to read in the file 'news.txt' into the variable $data as to print it out and show the user what they are about to delete....i am returned an empty array.

I am therefore also unable to actual delete that news item from the storage file.

I looked in the forum and read that if you dont close the file after writing/apending it, then this can happen....but i have checked my code and i have explicitly closed the file each time after opening it.

Also, Matt....if your reading this....can you please explain in a little more detail what difference the order in which we check for action='delete' etc. makes.
You said:

<?PHP
if($action == "delete" && isset($HTTP_POST_VARS['password'])) {
?>

"That line should go to the very top of our script. Definitely make it above the last snippet that checked for an action of delete."

Where it looks to me that this code is indeed itself checking for the action of delete....this is rather confusing.

Once again, I would appreciate yours and anyone elses helpful feedback.

Thanks heaps,

Luke

Reply With Quote
  #5  
Old December 17th, 2003, 02:14 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: REQUEST: News tutorial

Quote:
Yes, that worked....i do have register_globals turned off as i read somewhere that in general it is more secure....?? True?

no, not true. it just makes it easier to write sloppy code which could be insecure if you don't know what you're doing.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOtherTutorials > REQUEST: News tutorial


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway