Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

incorrect PHP code

3 views
Skip to first unread message

nos...@ms.com

unread,
Jan 18, 2018, 6:12:12 AM1/18/18
to
The following PHP code does not work correctly;

<div style="text-align:center"><img
src="scripts/captcha/index.php?<?php echo session_name()?>=<?php echo
session_id()?>" style="vertical-align:middle" /> <input type="text"
name="keystring"><br /><span class="fontsm">(word
verification)</span></div><br />

I believe there is a mismatch in the brackets for the IMG element.

Please could someone tell me what needs to be changed to get it to
work.

Thank you.

Ifrit

unread,
Jan 18, 2018, 6:57:25 AM1/18/18
to

nos...@ms.com

unread,
Jan 18, 2018, 7:02:20 AM1/18/18
to
Can you be specific? I can't see anything obviously wrong with the
code. Thanks.

Ifrit

unread,
Jan 18, 2018, 8:36:51 AM1/18/18
to
Try:

<img src=<?php echo "\"scripts/captcha/index.php?" . session_name() .
"=" . session_id() . "\" ?> style="vertical-align:middle" />

--
Ifrit

Ifrit

unread,
Jan 18, 2018, 8:39:10 AM1/18/18
to
Sorry:
<img src=<?php echo "\" . scripts/captcha/index.php?" . session_name() .

Ifrit

unread,
Jan 18, 2018, 10:33:22 AM1/18/18
to
Sorry again, the first one was the right one after all.

--
Ifrit

nos...@ms.com

unread,
Jan 18, 2018, 10:51:28 AM1/18/18
to
I tried;

<div style="text-align:center"><img src=<?php echo
"\"scripts/captcha/index.php?" . session_name() . "=" . session_id() .
"\" ?> style="vertical-align:middle" /> <input type="text"
name="keystring"><br /><span class="fontsm">(word
verification)</span></div><br />

and it says;

Parse error: syntax error, unexpected 'vertical' (T_STRING), expecting
',' or ';' in /home/ccompiler12/public_html/feedback.php on line 39

Advice? Thanks.

nos...@ms.com

unread,
Jan 18, 2018, 10:58:00 AM1/18/18
to
On Thu, 18 Jan 2018 15:26:58 +0100, "Christoph M. Becker"
<cmbec...@arcor.de> wrote:

>On 18.01.2018 at 12:12, nos...@ms.com wrote:
>
>> The following PHP code does not work correctly;
>
>What do you expect the code to do, and what does it do? See also
><http://www.catb.org/esr/faqs/smart-questions.html>.

It's for a CAPTCHA verification. It's hosted with GoDaddy. On the old
server, it worked. It's been transferred to a new server, and it
doesn't work.

The PHP spits out the following HTML code;

<img
src="scripts/captcha/index.php?PHPSESSID=331f5041b67145685c5401104c602876"
style="vertical-align:middle" />

So for some reason the IMG element fails to load the image.

Arno Welzel

unread,
Sep 5, 2018, 3:40:43 AM9/5/18
to
nos...@ms.com:
Then you have to check, why the URL

scripts/captcha/index.php?PHPSESSID=331f5041b67145685c5401104c602876

does not work. Maybe you forgot a slash at the beginning and it should be:

/scripts/captcha/index.php?PHPSESSID=331f5041b67145685c5401104c602876



--
Arno Welzel
https://arnowelzel.de
https://de-rec-fahrrad.de
http://fahrradzukunft.de
0 new messages