473,378 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

some explanation please

6
Expand|Select|Wrap|Line Numbers
  1. while($row = mysql_fetch_object($result))
  2.    {
  3.    ?>
  4.       <li><font size="-1"><b>
  5. <a href="story.php?id=<? echo $row->id; ?>"><? echo $row->slug; ?></a>
  6.  
  7. </b></font>
  8.       <br>
  9.       <font size="-2"><? echo formatDate($row->timestamp); ?></font>
Refering to the above, I am finding it difficult to understand the '?id=' part inside the href attribute. I would greatly appreciate it if somebode explains it to me.

in addition:
the following is part of the 'story.php' script that is linked to in the above code:
$id = mysql_escape_string($_GET['id']);

How is this $GET['id] working when there is no action="story.php" defined in the first page whatsoever?
Or, is it maybe that my failure to understand the "mysql_escape_string( )" function causing all this ambiguity in my mind? Please help.
Sep 12 '09 #1
2 1427
Atli
5,058 Expert 4TB
Hey.

The $_GET array gets it's data directly from the request URL.

So in a page with the URL: www.example.com?name=joe
The code "echo $_GET['name'];" would print "joe".

You don't need to actually submit a form. All that is required is that the data is correctly inserted into the URL.
Sep 12 '09 #2
bibiki
6
thanks Atli. I think that makes sense to me. I needed a confirmation of what I was already suspecting to be the case and you did offer the confirmation for me. I guess for now I should just look at the question mark in the href attribute as a short version of setting up a form, defining an action script, and determening the method (the $get versus $post)... which I guess is always a $_get...
That does i for me just fine. thank you again.
P.S.
ACTUALLY: Now i see my mistakes in what i wrote above... but anyways, a good lesson learned today.
Sep 12 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

22
by: bearophile | last post by:
Ville Vainio: >It's highly typical for the newbies to suggest improvements to the >language. They will usually learn that they are wrong, but the >discussion that ensues can be fruitfull anyway...
53
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
0
by: Tony Johansson | last post by:
Hello! I'm reading about design pattern adaptor in the GOF book and there is something that sounds strange. The text below each participant is the book explanation for each participant. I...
6
by: Buck Rogers | last post by:
Hi guys! Love your work! The below program is from K&R2, p22. ================================= #include <stdio.h> /* count digits, white space, others */ main() {
70
by: rahul8143 | last post by:
hello, 1) First how following program get executed i mean how output is printed and also why following program gives different output in Turbo C++ compiler and Visual c++ 6 compiler? void main()...
21
by: Jim | last post by:
I am trying to write an HTTP/HTTPS proxy server in VB.Net 2005. But, I don't really even know how the internal workings of a proxy should act. Does anyone have anything on the protocols used in...
6
by: TPJ | last post by:
Help me please, because I really don't get it. I think it's some stupid mistake I make, but I just can't find it. I have been thinking about it for three days so far and I still haven't found any...
56
by: richard | last post by:
So I wrote PyPI back a couple of years ago. It was just a simple cgi script and some distutils code. I needed to call it *something* and "Python Package Index" seemed like a fairly obvious name....
5
by: Y2J | last post by:
I am working through this book on C++ programming, the author is speaking of using linked lists. He gave and example which I found confusing to say the least. So I rewrote the example in a way that...
7
by: ramasubramanian.rahul | last post by:
hi i was trying to see how the compiler hides the static golbals from the linker and allows golbal varibale to be visable to the linker.i managed to figure out how it did that ( the .lcomm and...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.