riahc3 50 Â Team Colleague

Your magento url is:
../product/2/?imagenv=data:image..

Try with:
../product/2/imagenv/data:image..

Strange.....but Ill try to make that URL.....

riahc3 50 Â Team Colleague

Hey

Im seeing that I need to learn Javascript and using its classes, functions, declaring it, etc so I need something. What is a good way to learn Javascript (besides practice, because basically its all copy-paste so Im not learning what anything means)......

Thanks!

riahc3 50 Â Team Colleague

Still nothing.

The strange part is when I printed out:

<?php print_r($_GET);?>

It shows nothing (Array ())

That being said, I do pass another parameter (options) and this does get passed because at the end of the entire process, I call a web service that uses these parameters correctly. So I can confirm 100% that my variable imagenv GETS PASSED without a doubt. I just cannot display it for some odd reason. It makes no sense at all.

riahc3 50 Â Team Colleague

Hi, I know it is kind of silly to ask, you probably know it. What do you see if you do this?? $out = base64_decode('iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAACA0lEQVR4nO3cwUsUYRzG8UdhKa0oEREpCjoUSOlJgiAWIbp26FZQt+iS2CH0ImwGXj2IWiePhnSo6L5/2nQoqFmVRvd93+edfb+f8/B7vzDsLDvzzkoAAAAAAAAAAAAAAAAAAPxrU11tquvOwG8P1VOlnipJHyR9dAeV6rDBMfvRKyBJmjzj8QdRKjC0BXfAqOkEmLERYAYkvQ0466KksYDzinMn0tzxSHMxhNvugLbZSbBGrE8ghjDnDmiDp+4AAANm3QG5emNc+7NxbZzinjsgJ4vuANS9cAf88dwdgONuuQPcrrkDBhR/E3LFHXCCLXcAICnvy4Pzd5FNjperos27A/7jujsAdQ/cASjYd3dAQ8vugFTuugMaeuUOQIFCbIBL4+/G7pH2zh3QWCEn5LE74Ix23QGo++QOQN2qOyCml+6Ac3jtDoijvV+Q6+6AONp7Qr64A2KacgecQ8h3VbJzwR0AAKNrzx2Aupw3YhSn+F2MubnpDkhhwh3Q0CV3QCpt2VpzxR2QypI7oIFtd0BKI30ru41+uANQl/O1Obd3VYp2wx2AnvrqqS/pqjvF7Zs7QFKbH5gFl8P/Vh25A3LzyLRuRzwky8aaOyBrlVRVSnIN/5pgjfaLfEI6kp5Eml2EZwFmTIs7AcG9lzTT8NjLkn5Kuh8vBwAAAAAAAACAJn4Bse83Wq3XeMoAAAAASUVORK5CYII'); echo $out; That should give you something on the screen... I think :) UPDATED LATER: The above should give you something like this <div id="page" class="shell"><!-- Logo + Search + Navigation --><div id="top"><div class="cl">&nbsp;</div><h1 id="logo"><a href="SITE_URL/lib/skins/lolim/images/logo.gif">MONDAYS</a></h1><div class="field-holder"><br />

Go ahead and assume I know nothing :P

The $out variable is PHP AFAIK.. So it would be

<?php echo base64_decode($_POST['imagenv']); ?

If Im passing it thru post/get....

riahc3 50 Â Team Colleague

OK

On the second page (where the image is suppose to be displayed and it is a PHTML page) I have:

<script type="text/javascript">
                    function dibujofun()
                    {
                    var dibujo = localStorage.getItem('foto');
                    alert("soy dibujo fun" + dibujo);
                    return dibujo;
                    }

                    </script>

<script type="text/javascript">dibujofun();</script>

and it works (it returns the string with the data)

but

<img src=<script type="text/javascript">dibujofun();</script></img>

Doesnt. Why not?

This is driving me crazy....

riahc3 50 Â Team Colleague

Have you tried saving the data to localStorage? http://coding.smashingmagazine.com/2010/10/11/local-storage-and-how-to-use-it/

Well, Ive tried everything so trying something else wouldnt hurt :P

The only thing that I see is that his wouldnt work on IE8 right?

riahc3 50 Â Team Colleague

Any ideas/tips at all?

riahc3 50 Â Team Colleague

Here is a screenshot (to make sure there are no mistakes and Im not making this up or anything:

Click Here

riahc3 50 Â Team Colleague

print_r($_GET);

I also did as you said a

<?php print_r($_GET);?>

And (to my surprise) it printed

Array ( )

With problably means Firebug is lying to me......

Thanks for all the help :)

riahc3 50 Â Team Colleague

More digging.....

Using this code here:

                    <script type="text/javascript">

                    function getUrlVars() {
                        var vars = {};
                        var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function
                        (m,key,value) {
                        vars[key] = value;
                        });
                            return vars;
                            }

                    var first = getUrlVars()["imagenv"];
                    alert(first);

                </script>

I am able to see the values of the variables I pass thru GET and POST. When it pops up I get "undefined"

That doesnt make any sense because using Firebug I see that thru GET imagenv IS indeed getting passed with values so......

Man, Im happy its Friday and wont have to tackle this till Monday. But for now still 45 mins to go....

riahc3 50 Â Team Colleague

mandarAlCarro

Basically this goes to the other page. Technically it creates the url to go to the other page. Then (if setLocation is right) it goes to that page.

Ive just put the values in there using standard GET writing. And it DOES pass the values :) now displaying them is another issue.

Ive tried echoing it; Nothing
Ive tried <img src="(echoing)"></img> still nothing....

So frustrating when you feel you are so close yet so far.

riahc3 50 Â Team Colleague

Ive been all day with this so sorry for not reading :)

Ive FINALLY gotten the value pass over. The value being:

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAACCElEQVR4nO3aPWsVQRiG4ScmJpGACmowginEDxDUQhsh6VJErIMgiE3aFBbamOIIYiEiCiKCCiKGiOmD/25TrLD5ICbszuwzM3tfdc68N xZNntmJAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA5h5K iBpUdJtSUuStq1FAzMmaeuYfzuK2DF4y5IutvjcjdAhQ/e88wojVRqpCtAyaF CrcQF6eRBpHVPRlq3WKcknY24/q IaxfnRQ8z7vUwI3vfe5w10 Os7ExLGndHoPbDHYDarDsAjXfuANTOuQN2Oe0OcPvpDtjnjjvAZVJpvhU/cwc4bLgD/iO1Oza6m 6AI5xwB/Rl0R2Axid3ABopPrgP88gdENNLd0ALT90BsSy4A1C75A7oYMwdENofd0BHr90BIeV8ZxQl9Ze8Qdl0BwR03BOOybrgDggswwd6uYfIrrsD2in3gsy7A7q45g7AQevugICW3QGhvHUHBDDhDggt92/XfXdADGfcAS2ddwdgr0l3ABpf3QF9yPBNt3w5nFIv7j ro6R8p6y5A5xSe2j dgek4K474J9Vd0BKvpnnPzbPT9JV09zPprnZeNXjrI89zsralKRbkWdMR16/TJVUVQqw4dVsnL3vXjVguy7IitpvfF0ueCczGeuS3qj efyK6gMVc6qPHD2R9Fd5HeAGAAAAAADAXjv0OTZdFaBJ7wAAAABJRU5ErkJggg==

But, I cant get it to display. So now it does the GET correctly (passing it to the other page) but it doesnt display it.

This is in FF BTW...

riahc3 50 Â Team Colleague

No ideas?

riahc3 50 Â Team Colleague

After executing the Javascript the page ends up something like this (this is the PHTML page, where the submit button is but this is the pure HTML output)

<form id="imagen" method="post" name="imagen" action="javascript:void(0);">
<button id="botonCarrito2" class="button btn-cart" onclick="mandarAlCarro('http://host.dev/store/checkout/cart/add/uenc/aHR0cDovL21ldHJvbmljcy5kZXYvcGFzdGVsZXJpYXRvbG9zYW5hL3Bhc3RlbGVzLWRlLWNvcnRlLmh0bWw,/product/2/', 2, 2)" title="Add" type="submit">
<span>
<span>
Add
<input id="imagenv" type="hidden" value="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAACDklEQVR4nO3cMWsUQQCG4S8xarxCQW1CSCG2QlAEEYUrbIPpjGCwiZ12oo2Ke4eFjYWIIogSUELEfyBCSn/WWnhkvRhCLjc738zO+/Q383LL3u3u3YwEAAAAAAAAAAAAAAAAlG2ovobquzNKdlzSQNK2pIEq1apUS/ol6Z61rBC3JN054mu/SZoL2FKsnhT0Y6gn6UnA8YpxUdKJlue43fL4nXEl4lyLo++enYhzZuORZdZKtZ7pt2XuhG24AyR9cgek4qw74B8P3QFuJ90B+3jgDnA57Q44wHt3QDyVdrShn+6MQ3jsDogjr8vMY+6Atp1yB0wot96JzboDjuCDO6Atz90B6I5X7oDQ7rsD0D2FXAbnY8YdEMpTdwC666Y7YFqdOc1H3rkDprXmDgjshjtgWm/cAUE1fzVCEjggybnuDsC4t+4AjLvqDgCSdcEdgHGX3AFodOan3C/ugECW3AGhXHMHBLDuDkDHrbgDpnDOHRBevs9/XrgD2pHnAWFpQkI+uwPQeOkOiO28O+AAW+4ANDbdASlYcAeMXHYHpOSHce4c/4kfxaziny2rkefLUqydFbjHmNAg+IjNzWkv+NgF+a7XOhNkD6w8nxYkaKh+gDcy5t4pxZjX3w3LJlG10IE9DrOg/64KWM6cmo+1VNfaXe++LOmrM6h4ew4IAAAAAAAAAAAAAAAAAAD/+QPHG0cjw8oB2AAAAABJRU5ErkJggg==" name="imagenv">
</span>
</span>
</button>
</form>

As you see when I click the button, it is inside the form and should transfer that hiddent imagenv right?

riahc3 50 Â Team Colleague

Recap:

My javascript

$j(textoDelId, window.parent.document).html('Add<input type="hidden" id="imagenv" name="imagenv" value="'+imgstr+'"/>');     

My new submit button:

<form action="javascript:void(0);" name="imagen" id="imagen" method="post"><button id="<?php echo $idBotonCarritoCustom ?>" type="submit" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="mandarAlCarro('<?php echo $this->getAddToCartUrl($_product) ?>',
                        <?php $idOptionCorte = -1; foreach ($_product->getProductOptionsCollection() as $option) {
                        if($option->getTitle() == 'Corte') {
                            $idOptionCorte = $option->getOptionId();
                        }}
                            echo $idOptionCorte?>, <?php echo $_product->_getData('entity_id'); ?>)">
                        <span><span><?php echo $this->__('Add to Cart') ?></span></span></button></form>

And finally the final destination:

<?php echo $_POST["imagenv"]; ?>

imgstr has the correct value as a alert after that JS line, shows that string that I want to pass.

riahc3 50 Â Team Colleague

I used for action

javascript:void(0)

and it went to the link. But now the post (data) doesnt get thru....

riahc3 50 Â Team Colleague

Almost got it :)

Now, I just need to go to its original link instead of "#"

How can I do this?

riahc3 50 Â Team Colleague

Back.......

Im trying to see if I can change that button to a submit and have it all still work. It should.

riahc3 50 Â Team Colleague

Going to lunch. Be back in 2 hours.

Thanks for all the help! :)

riahc3 50 Â Team Colleague

Also, I generate the form via Javascript so sadly I cant do document.forms.submit() (or however the function is)

riahc3 50 Â Team Colleague

?

riahc3 50 Â Team Colleague

Like I commented, the onClick is not generated by me but by the instalation (this is Magento BTW).

Now, would something like this work:

<input name="submit" value="submit" type="submit" style="display:none">Con Corte - Añadir carro</input>

riahc3 50 Â Team Colleague

Your code works for me.
Where is submit button?
Are you using javascript for rediretion?

Didnt see page 2 :P

This is the entire code

<button id="botonCarrito2" class="button btn-cart" onclick="mandarAlCarro('http://localhost.dev/store/checkout/cart/add/uenc/aHR0cDovL21ldHJvbmljcy5kZXYvcGFzdGVsZXJpYXRvbG9zYW5hL3Bhc3RlbGVzLWRlLWNvcnRlLmh0bWw,/product/2/', 2, 2)" title="Añadir al carrito" type="button">
<span>
<span>
<form id="imagen" method="post" name="imagen" action="#">
Con Corte - Añadir carro
<input id="imagenv" type="hidden" value="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAACTklEQVR4nO3cPYsTQQDG8ecih3iK71eIimhxIuphoYU2XmGrhdrYio2CWIkYrlhOO8HGQg4VPBDf7kNc7adaiwgm7sZkczPzzGb/vzaw8ydDstnNzEoAAAAAAAAAAAAAAAAI5oWkx5LOjXm9J2lF0lNJm6miuuZ7oON8lXQg0LE6plCpvn5FHKGvDd1UoTLiGHPjowqVKrQTdZS/E/Ig6jgtt2wc+5tx7OzsdQcMWXcHuB10B9ToSTrhjnDY4w6YYMMdkNqCO2AKC5KOuSNSOOsOaOiDOyCmtv6ieeQOiCH388YkJ90BoZ13BwSw3x0QylF3QEA5XTvNbN4+7ofcAbuxzx0QyWV3wKzeuQMieusOQNUbdwCqjrgDptXWC8FmCu205U+vi+6AJFo0IV1z2x0AZO+eO6De4Hs17oKFfJ1xB1QNVpBwosvMaXeA0Xt3QJ3P7gBgWJb38XruAIy67g4w23IH1OnyyR0ZWnEH1LnrDjC64Q4Y56c7AFVZnuQSeOkO+J8f7gCDS+6ASTq/HyNHx90BiR12B0zrqjsgkb47oInn7oAEnrgDZpHlRVTX3XcHoN5rdwCqFiWdckeg6oravwtrLq13fEVLhtq7omXJHYBR2+4AjHI+ZCeZO+4AVH1xB0zhkzsgtVfugLFSPJgtU2vugFodnhBJuuUO+Mc1d0AOHroD/rjgDsiJc/V5T+14JlhyS0r/xnRj5/EubZVSWSrq7RYmoomhCVkMeNhVsfM2mGdqfpW/rMGjyzPcQwgAAAAAAAAAAACg/X4DEkhHs9fYkWsAAAAASUVORK5CYII=" name="imagenv">
</form>
</span>
</span>
</button>

That is the button :) As you can see the redirection is indeed via Javascript and that long URL is dynamically generated so I cant just make a submit button and point it there.

riahc3 50 Â Team Colleague

New code:

<form id="imagen" method="post" name="imagen" action="#">
Con Corte - Añadir carro
<input id="imagenv" type="hidden" value="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAACA0lEQVR4nO3cwUsUYRzG8UdhKa0oEREpCjoUSOlJgiAWIbp26FZQt+iS2CH0ImwGXj2IWiePhnSo6L5/2nQoqFmVRvd93+edfb+f8/B7vzDsLDvzzkoAAAAAAAAAAAAAAAAAAPxrU11tquvOwG8P1VOlnipJHyR9dAeV6rDBMfvRKyBJmjzj8QdRKjC0BXfAqOkEmLERYAYkvQ0466KksYDzinMn0tzxSHMxhNvugLbZSbBGrE8ghjDnDmiDp+4AAANm3QG5emNc+7NxbZzinjsgJ4vuANS9cAf88dwdgONuuQPcrrkDBhR/E3LFHXCCLXcAICnvy4Pzd5FNjperos27A/7jujsAdQ/cASjYd3dAQ8vugFTuugMaeuUOQIFCbIBL4+/G7pH2zh3QWCEn5LE74Ix23QGo++QOQN2qOyCml+6Ac3jtDoijvV+Q6+6AONp7Qr64A2KacgecQ8h3VbJzwR0AAKNrzx2Aupw3YhSn+F2MubnpDkhhwh3Q0CV3QCpt2VpzxR2QypI7oIFtd0BKI30ru41+uANQl/O1Obd3VYp2wx2AnvrqqS/pqjvF7Zs7QFKbH5gFl8P/Vh25A3LzyLRuRzwky8aaOyBrlVRVSnIN/5pgjfaLfEI6kp5Eml2EZwFmTIs7AcG9lzTT8NjLkn5Kuh8vBwAAAAAAAACAJn4Bse83Wq3XeMoAAAAASUVORK5CYII=" name="imagenv">
</form>

On the PHP page (which when I click on that link it leads me to there) I do this:

<?php echo $_POST["imagenv"]; ?>
riahc3 50 Â Team Colleague

Still nothing.......does not pass the value.

riahc3 50 Â Team Colleague

I did it to make sure it passes...........

Ill try rename the input field then.

riahc3 50 Â Team Colleague

Did it worked?? Make thread solved if it is..

Im still not clear with your code as you are drawing and I can already draw.

None the less, Im trying with the second method you posted which is a hidden field. I can perfectly store the value in the value field of my hidden input box but when trying to access it via PHP via POST it is like it doesnt exist. I have some doubts of the reason why.

My code is basically:

<form id="imagen" method="post" name="imagen" action="#">
Con Corte - Añadir carro
<input id="imagen" type="hidden" value="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAACIklEQVR4nO3bz4tNYRzH8fcY5MewENJQUoOyJEnKKKnZsaAsyGJK+AOsb1NYStn4kZLYkI2oWfnTjoWROUkzc+8553Oec9+v3V3c57xvzzl17r3fA5IkSZIkSZIkSZIkSZIkqWdGVIyogHlgFbgLnNjgXUeAG8APYFu7gdNjGVhatyGT2g08bGCdqfKWbs7omx0co1j3Y0e+xuOGrr5BeJMOYIXFtQ15l05JepkO+I9L6YCuzdH/O57ZdEBXPqYDtmguHdCmi+mAMe1JB7ThQDpAf51PBzRgRzpgciN+Duze/lY6YDLD2xCA5+mASRR+RqkU19MB47iaDmhZcbfCT9IBLTueDtC/9qUDVPcoHSD13u10gOoW0wEq1FI6QHWv0wEdOpkO2IxT6YAOLacDVFfMpMqudEBHVtMBm5Wft+rG93SA6or+02pYmhsA78zXdECrCtyQvk8oTqWD6YAWzacDxjHkL07v0wEaiE/pgBY8SAeorvhHFu6kAxo0pM+iPrmcDmjAvXRAk0qfZSpyjHQjp9MBqiv+7mSIjqYDtmh7OqBth9IBW7AzHdCVIqY1pkmff5pfSAdkjKhY6d045pd0QM6IirN8SGesmQH2piP6YobsQ6Kfg8futVngTIfH80fCTdoPXGhx/Vf8vio1hhcNrTMPPGtoLQGHgW9/XlRQVWw4gvMUuNJmlNas25AF4BxwLJwkSZIkSZIkSZIkSSrfL4jkPrc69QHbAAAAAElFTkSuQmCC" name="imagen">
</form>

Now, you may be wondering about my action; This already does link me (this code is actually inside a button with a onclick action that leads me somewhere else so like I mentioned it is not needed) to somewhere but in action I cant put a link because it is dynamically generated. Action AFAIK is mandatory so I just put that to try it to pass. For some reason in PHP (with a simply <?php echo $_POST[imagen]; ?> I cannot get it to show. It just shows up blank.

As you can see, in value the data is perfectly there but I cannot pass it to another page.

Thanks for all the help!

riahc3 50 Â Team Colleague

document.getElementById('myImg').src = getCookie('myImage');

With that, there is a possibility I can store than in the cookie right?

riahc3 50 Â Team Colleague

I ahve created demo code again :) Try now:

Thanks a lot for the code :) I really appritiate it :)

The problem is, i already have a canvas and I can already draw on it. What i simply want to do is make a "screenshot" of it and transport that screenshot else where. The "hidden form" from what is seems is what you are suggesting to do so I can transport it elsewhere right?

riahc3 50 Â Team Colleague

Besides the article choice, the editor is possible the worst Ive seen in my life, including old school boards. AT LEAST, the choice of writing plain text (where we can use our classic [quote][/quote] tags) would be nice. This is just horrible.

riahc3 50 Â Team Colleague

I dont have to display it either; As long as I can get the string to put it in a

<img src

Im fine....

riahc3 50 Â Team Colleague

Putting

canvas.toDataURL("image/png");

in my code (with var canvas=document.getElementById("can"); before it) prints out the same thing. [object HTMLImageElement]

riahc3 50 Â Team Colleague

(The quoting system here is horrible)

Is this demo code from the library of canvas2image? I couldnt find it on the site.

riahc3 50 Â Team Colleague

The library is this one BTW: http://www.nihilogic.dk/labs/canvas2image/

riahc3 50 Â Team Colleague

In Javascript:

var canvas=document.getElementById("can");

            var ojpeg=Canvas2Image.saveAsPNG(canvas,true,100,100);

            document.cookie ='laimagen='+ojpeg+'; expires='+dia.toGMTString()+'; path=/';




            var imgHtml = ojpeg; 
            alert (imgHtml);

Alert pops up with [object HTMLImageElement] and I need to put valid HTML so I can use it in PHP.....

riahc3 50 Â Team Colleague

I'm currently at a break so in a few mintues, ill post some more code.

I used a canvas2image JS library, in Javascript, I was able to generate the image and display it but I want to save the html code in a cookie and just display it.

riahc3 50 Â Team Colleague

Hey

I tried to access a cookie that has a [object HTMLImageElement] but when I try to echo it, it simply prints that out: [object HTMLImageElement] I want it to display the picture.

How can I do this?

Thanks

riahc3 50 Â Team Colleague

Hey

I have the following:

<?php echo $_COOKIE["name"];?>
<?php echo $_item->getId();?>

With the $_COOKIE["name"] having a value of "hi" and the $_item->getId() having a value of "5" (or 5, irrelevent as it is all strings)

what if I want to do something like (fake nonworking code):

concat joins 2 strings.

echo concat($_COOKIE["name"],$_item->getId());

Which would print out "hi5".

How can I do this?

Thank you

riahc3 50 Â Team Colleague

use jquery cookie plugin, it's easy to set and retrieve a cookie. https://github.com/carhartl/jquery-cookie it's almost 2kb only. Set an expiring cookie: $.cookie('the_cookie', 'the_value', { expires: 7 }); Set a session cookie: $.cookie('the_cookie', 'the_value'); Retrieve that cookie: $.cookie('the_cookie'); Delete that cookie: $.cookie('the_cookie', null); So simple yet effective. You can store any values you want to that cookie, you could reset it's value too.

(Javascript is not a strong point of mine)

1: How do I use this in a PHTML page? I cant seem to include this library
2: How do I include this script in another JS file? Thus making "$.cookie" avaliable

riahc3 50 Â Team Colleague

Cookies, local storage, indexDB, WebSQL, you can use any of these to keep persistent data accross your site. I'd suggest cookies or local storage, you will have browser issues with indexDB and WebSQL and as long as it's not a lot of data.

Not really sure whats the difference between Cookies and local storage :P but I dont mind either way.

My main object right now is to

1: Clicking a button that executes Javascript, inside a Javascript function, store a value in a Cookie (or local store)
2: In a completely different PHTML page, have it show that variable's value.

Thank you for helping :)

riahc3 50 Â Team Colleague

how about using $_SESSION ?? http://w3schools.com/php/php_sessions.asp

But in a Javascript context (well or HTML, depends) I cant store a PHP session variable can I?

You could try making a script and insert it on all your pages. In php, you would have to write the session on top of every page, so why not include a script on every page.

Hope this helps

I already have a Javascript which I execute when I click the button that interacts (so to speak) with the name. I tired to use "document.cookie" but obviously it only applies to the CURRENT page, not any others.

Also, if I do indeed load a script on every page, besides the penalty in loading it, I would have to make sure that I dont overwrite the variable each time I load it right? I just use it on ONE page (and it is opinional)

riahc3 50 Â Team Colleague

No tips/ideas/alternatives/etc at all?

riahc3 50 Â Team Colleague

Hey

I want to declare a variable that is global that I can use (and modify) all over my website. Ive read that I may be able to do it with jQuery but not sure how to (more importantly, where).

Its a simple text field, nothing else. Specifically it must be able to be accessed in Javascript, PHP and phtml (which is PHP allowed with HTML right?)

Thank you!

riahc3 50 Â Team Colleague

I put something wrong (wrong here, not in the code):

//this code is in a JS function inside the Lightbox called saveAndClose
document.cookie="cookiebox=" + document.getElementById('cookiebox').value;
riahc3 50 Â Team Colleague

Hey

Let me see how I describe this....

I have a textbox (inside of a form) and that form also has a button that calls a Javascript function that does some unrelated stuff. This is all inside of Lightbox. I want to be able to type in text in that textbox, save it (somehow), click the button that not only calls the JS function but closes the Lightbox and still have that valued store.

Now I know that PHP is server side and JS is client side so I would have to somehow pass it to the server and store it there temp. Several answers come to mind (which I dont know how to implant at all):

1: AJAX
2: Cooke/session/etc.

As for 1, I think it is the best way but I have no idea how to implant something as simple as this. As for 2, Ive tried but it just doesnt work....

2:

Using a cookie (Yes, I know it is a overkill for this) (This is my Lightbox):

//this code is in a JS function inside the Lightbox called saveAndClose
document.cookie="cookiename=" + document.getElementById('cookiebox').value;

The HTML of the principal page (the LightBox is in a iframe I believe which is opened from the principal page emulating a popup of sorts) is:

<form name="save" id="save" action="saveAndClose">
        <div id="actions">
            <input type="text" id="cookiebox" name="cookiebox"/>
            <input type="submit" id="saveAndClose" name="saveAndClose" value="OK" title="Final"/>
        </div>

        </form>

And finally the PHP side of things:

<?php echo $_COOKIE['cookiebox']; ?>

Ive also tried with …

riahc3 50 Â Team Colleague

Hey

Im trying to add links in the images for EasySlide but I cant see to see where to put it.....

Here is the .js code:

/**
 * @author Bruno Bornsztein <bruno@missingmethod.com>
 * @copyright 2007 Curbly LLC
 * @package Glider
 * @license MIT
 * @url http://www.missingmethod.com/projects/glider/
 * @version 0.0.3
 * @dependencies prototype.js 1.5.1+, effects.js
 */
/*  Thanks to Andrew Dupont for refactoring help and code cleanup - http://andrewdupont.net/  */

Glider = Class.create();
Object.extend(Object.extend(Glider.prototype, Abstract.prototype), {
    initialize: function(wrapper, options){
        this.handStopped = false;
        this.animating = false;
        this.wrapper = $(wrapper);
        this.scroller = this.wrapper.down('div.scroller');
        this.contentDiv = this.scroller.down('div');
        this.current = $(this.contentDiv.children[0].id);
        this.sectionWidth = this.contentDiv.children[0].getWidth();
        this.slideRelations = {};

        this.options = Object.extend({
            effectType: 'mosaic',
            duration: 3.0,
            frequency: 3,
            eRows: Prototype.Browser.IE ? 3 : 6,
            eCols: Prototype.Browser.IE ? 6 : 12,
            eColor: '#FFFFFF'
        }, options || {});

        this.effects = {
            'scroll'        : this.scroll,
            'speedscroll'   : this.speedscroll,
            'fade'          : this.fade,
            'blend'         : this.blend,
            'mosaic'        : this.mosaic
        };

        this.sections = this.wrapper.getElementsBySelector('div.section');
        for (var i = 0; i < this.sections.length; i++) {
            var nextSibling = this.sections[i].nextSiblings()[0];
            if (nextSibling){
                this.slideRelations[this.sections[i].id] = nextSibling.id;
            } else {
                this.slideRelations[this.sections[i].id] = this.sections[0].id;
            }
            this.effects[this.options.effectType].bind(this)().prepare(this.sections[i], i);
        }

        this.events = {
            mouseover: this.pause.bind(this),
            mouseout: this.resume.bind(this)
        };

        this.addObservers();


        if (this.options.autoGlide) {
            this.start();
        } else {
            this.handStopped = true;
        }
    },



    scroll: function() {
        var glider = this;
        return {
            prepare: function(el, i) {
                if (i > 0) {
                    $(el).setStyle('left: ' + glider.sectionWidth + 'px;');
                } else {
                    glider.toggleControl($$('a[href="#' + el.id + '"]')[0]);

                }
            },
            animate: function(elementIdToShow, direction) {
                $(elementIdToShow).setStyle('left: ' + (direction === 'normal' ? …
riahc3 50 Â Team Colleague

OK, reverse works.

The PC I want to connect from, A, cannot connect to the PC I want to connect to, B.
But B can connect to A.

B runs XP, A runs 7.

Any more information? So strange....

riahc3 50 Â Team Colleague

Tried with MySQL Workbench and cant either.....There is no firewall installed on the other PC (and mine doesnt have one either)

riahc3 50 Â Team Colleague

I dont think its a firewall as currently there are non running on that PC.

Im trying this now Windows to Windows (it was Windows to Linux) and still nothing.

The permission is set correctly with a user created to connect from anywhere....Still nothing.

riahc3 50 Â Team Colleague

Do you have Microsoft Query installed or any tool with which you can test the remote connection?
Your code might not be the problem. It could be your firewall.

Never heard of "Microsoft Query". Where can I find it?

Thanks