473,385 Members | 1,370 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,385 software developers and data experts.

php + javascript

3
hi
first let me say that im not a php programmer (till now all i did was asp)
i realize that php is kinda easy to understand and im giving it a shot...
so please be patience... (-:
i want to do this:
take varible from a url, in asp i could use request.querystring but i understand that its not safe to use it with php (i have to register_globals=on) so i decided to listen and not to use it.
i cant use a form.
so i thought using javascript, take the var from the url put it in a javascript function and then send it to the php function.
or maybe there is a better way to this....
can you guys give some directions or a function the does this
thank you
Yaniv
Apr 11 '07 #1
4 1225
yaniv
3
maybe more details...
i want this:
<a href="www.myDomain.com/index.php?id=XXX" target="_blank">TEST</a>
in the index.php, use the "id" value
Apr 11 '07 #2
ak1dnar
1,584 Expert 1GB
hi
first let me say that im not a php programmer (till now all i did was asp)
i realize that php is kinda easy to understand and im giving it a shot...
so please be patience... (-:
i want to do this:
take varible from a url, in asp i could use request.querystring but i understand that its not safe to use it with php (i have to register_globals=on) so i decided to listen and not to use it.
i cant use a form.
so i thought using javascript, take the var from the url put it in a javascript function and then send it to the php function.
or maybe there is a better way to this....
can you guys give some directions or a function the does this
thank you
Yaniv
Using the register_globals=on is a default feature with the modern PHP versions.How ever there are lots of ways to do what ever you need.

You can use sessions to pass the variables with your application.Give it a try by using this Tutorials.
http://www.w3schools.com/php/php_sessions.asp
http://www.tizag.com/phpT/phpsessions.php

And according to your suggestion,if you familiar with JS that also possible, with some ajax.
Read thisThread you will get a answer. here no need of ajax. try to find out it by your self.
Apr 12 '07 #3
if the address is this index.php?id=value

then the variable id could be use like this $_GET['id']
if you want to read all the query string (variable and their values) you can use $_SERVER['QUERY_STRING']

no need to use javascript for this even if safe mode is enable.

also if you use the method post you can use the variabla with this syntax $_POST['variable']
Apr 12 '07 #4
yaniv
3
hi
first thanks for your replies!

you mean:
the url is ....index.php?id=XXX
and in the index.php i do $_GET[id] and i will get the XXX?
Apr 12 '07 #5

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

Similar topics

0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.