Jump to content

php passing parameter through link using $_get and echoing the divs assoicated with each attribute...


malanno

Recommended Posts

Hello

 

this is an example of my link...

 

.../pes/mimo.php?rack=1+jobs=0+hosts=1

 

I'm passing the variables like this...

<?php

echo $_GET["rack"] ;

echo $_GET["jobs"] ;

echo  $_GET["hosts"] ;

?>

Rack would echo a grouping of divs with the contents: r1, r2, r3

Jobs it's grouping of divs: j1, j2, j3

Hosts: h1,h2, h3

 

I'm looking to connect the dots between passing the parameter and getting the data... Anyone feel me?

 

Best, William

Edited by malanno
Link to comment
Share on other sites

Uhhh, This is a forum where we help you with the code you are trying to write. So - you should take a stab at writing your idea in code and testing it asking for help in perfecting it.

 

btw

 

1 - your url should look use ampersands instead of + signs for the second and third parms.

 

As for the rest of your explanation of what you want to do, I'm a bit confused. Your url provides one value for each parm but you want to get "groups of divs" out of each one? Hmmm...

Link to comment
Share on other sites

I'm not looking for someone to write my code... It's almost written because of my company I can't share it. It would illegal for me to do so and I could be punished. I'm a python writer and got stuck with this php project. Your remark is absolutely no help... yes, I always to + by default that's python, but that wasn't my question.

 

After 20 years programming chips in one of the best companies in the world, I've been there done that with the stereotypical bad attitude programmer type.

 

I don't php and neither does anyone around here but we drew straws and I got this stupid project...

 

With regards to the code... I'm using $_get to pass the parameters and I'm using document.GetElementById to get the data... I can't share my code it breaks all sorts of agreements with my company. I would lose my clearance...

 

That's all... Sorry to lash out, normally I would just move on, but like I said, I'm tired of that old stereotype... 

Edited by malanno
Link to comment
Share on other sites

The first variable in a query string follows a ?, which you are doing. Subsequent variables get added using the ampersand (&), but you are using a plus (+) which means a space character in URLs.

 

.../pes/mimo.php?rack=1&jobs=0&hosts=1

 

$rack = $_GET['rack'];
$jobs = $_GET['jobs'];
$hosts = $_GET['hosts'];
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.