...

View Full Version : unwanted /



rafiki
03-08-2008, 04:38 PM
whats up with this line


<LABEL for="subject">Subject:</LABEL><input id="subject" type="text" name="subject" value=<?php if (isset($_GET['subject']) && !empty($_GET['subject'])) { echo $_GET['subject'] . '" readonly" .'; } ?> /><br /> the page is at www.jamiewest.org.uk/contact.php
its not there on www.jamiewest.org.uk/contact.php?subject=Whatever

oesxyl
03-08-2008, 04:45 PM
whats up with this line


<LABEL for="subject">Subject:</LABEL><input id="subject" type="text" name="subject" value=<?php if (isset($_GET['subject']) && !empty($_GET['subject'])) { echo $_GET['subject'] . '" readonly" .'; } ?> /><br /> the page is at www.jamiewest.org.uk/contact.php

this give me this:

Parse error: syntax error, unexpected ';' in removed path because reveal unsafe and irelevant details for user users



its not there on www.jamiewest.org.uk/contact.php?subject=Whatever

best regards

Fumigator
03-08-2008, 04:46 PM
Put double quotes around your value parameter's value.



<input type="text" value="hi" /><br />


(edit) wow, I was beaten by 2 within a minute

kbluhm
03-08-2008, 04:46 PM
Very simple. Use proper HTML and put the attribute values in double quotes. You use double quotes in every other attribute except for the value attribute. Why is that?


<LABEL for="subject">Subject:</LABEL><input id="subject" type="text" name="subject" value="<?php if (isset($_GET['subject']) && !empty($_GET['subject'])) { echo $_GET['subject'] . '" readonly" .'; } ?>" /><br />

rafiki
03-08-2008, 04:46 PM
check again, i was messing around with the code it works now atleast for me..



<LABEL for="subject">Subject:</LABEL><input id="subject" type="text" name="subject" value="/*added to open*/<?php if (isset($_GET['subject']) && !empty($_GET['subject'])) { echo $_GET['subject'] . '"/*close " for value*/ "readonly"' ; } ?> /><br />

rafiki
03-08-2008, 04:51 PM
thanks all its working correctly :)

oesxyl
03-08-2008, 04:58 PM
check again, i was messing around with the code it works now atleast for me..


I guess the problem is somewhere in fetching parametes from request.
Did you use REQUEST_URI or similar to extract query string from it?

best regards

rafiki
03-08-2008, 05:04 PM
no... i think it was a case of just using ""'s correctly



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum