Orphy Posted March 25, 2006 Share Posted March 25, 2006 [code]<HEAD><TITLE>Test page</TITLE></HEAD><BODY><FORM METHOD="get" ACTION="graphtest.html"><INPUT TYPE=hidden NAME=choice VALUE=request>Type stock symbol(like: bby) <INPUT TYPE="text" SIZE="20" NAME="search" VALUE=""><INPUT TYPE="submit" VALUE="Search!"></FORM><?phpif ($choice == request){echo "<img src= "http://ichart.finance.yahoo.com/z?s=""$search""&t=1y&q=c&l=on&z=m&a=v&p=s/>""};?></BODY></HTML>[/code]Please look at the echo feature, I do not know how to use the proper syntax . Basically I want a user to submit a symbol and I will give out the graph and that graph is in [a href=\"http://ichart.finance..\" target=\"_blank\"]http://ichart.finance..[/a]. url. The $search would be the input. So basically if someone typed BBY in the box, the output will give the graph of bby.Many thanks. Quote Link to comment https://forums.phpfreaks.com/topic/5777-fix-my-syntax-please/ Share on other sites More sharing options...
swatisonee Posted March 25, 2006 Share Posted March 25, 2006 How can it be hidden and inputted in the same form ? if its hidden then it has obviously come in from an earlier page .Also,[code]<INPUT TYPE="text" SIZE="20" NAME="search" VALUE="">should be <INPUT TYPE="text" SIZE="20" NAME="search" >[/code]HTH Quote Link to comment https://forums.phpfreaks.com/topic/5777-fix-my-syntax-please/#findComment-20587 Share on other sites More sharing options...
Orphy Posted March 25, 2006 Author Share Posted March 25, 2006 Thank you swat, I will fix this and see what happens but before that I am getting error on "echo" line.Is that how it supposed to be given waht I want as mentioned above. I can follow logic but not syntax. Quote Link to comment https://forums.phpfreaks.com/topic/5777-fix-my-syntax-please/#findComment-20645 Share on other sites More sharing options...
Gast Posted March 25, 2006 Share Posted March 25, 2006 [!--quoteo(post=358318:date=Mar 25 2006, 06:28 PM:name=Orphy)--][div class=\'quotetop\']QUOTE(Orphy @ Mar 25 2006, 06:28 PM) [snapback]358318[/snapback][/div][div class=\'quotemain\'][!--quotec--]Thank you swat, I will fix this and see what happens but before that I am getting error on "echo" line.Is that how it supposed to be given waht I want as mentioned above. I can follow logic but not syntax.[/quote]There are a couple of errors I can see:[code]<?phpif ($choice == request) {// The above line may need to read// either "$request" or "'request'"echo "<img src= "http://ichart.finance.yahoo.com/z?s=""$search""&t=1y&q=c&l=on&z=m&a=v&p=s/>""// This line should be:// echo "<img src=\"http://ichart.finance.yahoo.com/z?s=".$search."&t=1y&q=c&l=on&z=m&a=v&p=s\" />";};?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/5777-fix-my-syntax-please/#findComment-20651 Share on other sites More sharing options...
Orphy Posted March 25, 2006 Author Share Posted March 25, 2006 Hey gast, thank you very much for taking the time out to reply, Yes the code looks cleaner now. But I am still getting an error. Basically the error is in the whole php codes I think. Thats what I see in dreamweaver.Is the code logical?Basically what am I trying to do is, take the user's input and stick in the $search of yahoo url. Quote Link to comment https://forums.phpfreaks.com/topic/5777-fix-my-syntax-please/#findComment-20705 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.