473,698 Members | 2,275 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

simple Code Question

6 New Member
I own a simple Virtual Tour Site. At this time I can't afford to hire a programmer to make it everything that I want so I am trying my best to have it function for the time being as best as I can using out of the box templates. I would like to add a simple feature to the front of my site. This site is www.towncenter. com I store the tours in directories off of the main page... For example a recent tour I shot I gave a code of "242" so the URL would be http://www.towncenter. com/242 .... I would like to add a simple text box on the main page that would allow the use to put in 242 hit enter and they would be directed to http://www.towncenter. com/242 ... Some people just don't understand how to type in the 242 themselves in the address bar...

I would really appreciate help with this and I am very open to any other site suggestions... Thanks for your time...

Sincerely,

John
Jan 25 '07 #1
10 1613
ronverdonk
4,258 Recognized Expert Specialist
The title of your thread doesn't say very much about its content. Anyway, this snippet will do it[php]<?php
if (isset($_POST['number'])) {
header('Locatio n: http://www.towncenter. com/'.stripslashes( $_POST['number']));
exit;
}
else {
echo '<form method="post" action="'.$_SER VER['PHP_SELF'].'" >';
echo 'Enter value <input type="text" size="3" name="number" />';
echo ' <input type="submit" value="Submit value" />';
echo '</form>';
}
?>[/php]
Ronald :cool:
Jan 25 '07 #2
pipponino
6 New Member
Hi Ronald,

I really appreciate your help very much... I will put this into my page....

Again very much thanks....

Sincerely,

John
Jan 26 '07 #3
pipponino
6 New Member
The title of your thread doesn't say very much about its content. Anyway, this snippet will do it[php]<?php
if (isset($_POST['number'])) {
header('Locatio n: http://www.towncenter. com/'.stripslashes( $_POST['number']));
exit;
}
else {
echo '<form method="post" action="'.$_SER VER['PHP_SELF'].'" >';
echo 'Enter value <input type="text" size="3" name="number" />';
echo ' <input type="submit" value="Submit value" />';
echo '</form>';
}
?>[/php]
Ronald :cool:
I tried it at the following location and it doesn't seem to work... Any idea what I did wrong? the link is http://www.towncenter. com/tourid.php
Jan 26 '07 #4
ronverdonk
4,258 Recognized Expert Specialist
I tried it at the following location and it doesn't seem to work... Any idea what I did wrong? the link is http://www.towncenter.com/tourid.php
You have translated the code I sent you using htmlentities so it won't work. This is a line of code I sent you[php] echo 'Enter value <input type="text" size="3" name="number" />';[/php]
This is what is shown in the browser[php]Enter&nbsp;valu e&nbsp;&lt;inpu t&nbsp;type=&qu ot;text&quot;&n bsp;size=&quot; 3&quot;&nbsp;na me=&quot;number &quot;&nbsp;/&gt;[/php]
You have translated that code into an html tag free string. How did you put that code snippet in your own script? Show the code where you put it.

Ronald :cool:
Jan 26 '07 #5
pipponino
6 New Member
[php]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:sc hemas-microsoft-com:vml" xmlns:o="urn:sc hemas-microsoft-com:office:offi ce">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<title></title>
</head>

<body>

<p><code><fon t color="#000000" ><font color="#0000bb" >&lt;?php<br />
<BR></font><font color="#007700" >if&nbsp;(isset (</font><font color="#0000bb" >$_POST</font><font color="#007700" >[</font><font color="#dd0000" >'number'</font><font color="#007700" >]))&nbsp;&nbsp;{ <br />
<BR>&nbsp;&nbsp ;</font><font color="#0000bb" >header</font><font color="#007700" >(</font><font color="#dd0000" >'Location:&nbs p;http://www.towncenter. com/'</font><font color="#007700" >.</font><font color="#0000bb" >stripslashes </font><font color="#007700" >(</font><font color="#0000bb" >$_POST</font><font color="#007700" >[</font><font color="#dd0000" >'number'</font><font color="#007700" >]));<br />
<BR>&nbsp;&nbsp ;exit;<br />
<BR>}<br />
<BR>else&nbsp;{ <br />
<BR>&nbsp;&nbsp ;echo&nbsp;</font><font color="#dd0000" >'&lt;form&nbsp ;method=&quot;p ost&quot;&nbsp; action=&quot;'</font><font color="#007700" >.</font><font color="#0000bb" >$_SERVER</font><font color="#007700" >[</font><font color="#dd0000" >'PHP_SELF'</font><font color="#007700" >].</font><font color="#dd0000" >'&quot;&nbsp;& gt;'</font><font color="#007700" >;<br />
<BR>&nbsp;&nbsp ;echo&nbsp;</font><font color="#dd0000" >'Enter&nbsp;va lue&nbsp;&lt;in put&nbsp;type=& quot;text&quot; &nbsp;size=&quo t;3&quot;&nbsp; name=&quot;numb er&quot;&nbsp;/&gt;'</font><font color="#007700" >;<br />
<BR>&nbsp;&nbsp ;echo&nbsp;</font><font color="#dd0000" >'&nbsp;&lt;inp ut&nbsp;type=&q uot;submit&quot ;&nbsp;value=&q uot;Submit&nbsp ;value&quot;&nb sp;/&gt;'</font><font color="#007700" >;<br />
<BR>&nbsp;&nbsp ;echo&nbsp;</font><font color="#dd0000" >'&lt;/form&gt;'</font><font color="#007700" >;<br />
<BR>}<br />
<BR></font><font color="#0000bb" >?&gt;</font><br />
</font></code></p>
<?php
if (isset($_POST['number'])) {
header('Locatio n: http://www.towncenter. com/'.stripslashes( $_POST['number']));
exit;
}
else {
echo '<form method="post" action="'.$_SER VER['PHP_SELF'].'" >';
echo 'Enter value <input type="text" size="3" name="number" />';
echo ' <input type="submit" value="Submit value" />';
echo '</form>';
}
?>
</body>
</html>[/php]
You have translated the code I sent you using htmlentities so it won't work. This is a line of code I sent you[php] echo 'Enter value <input type="text" size="3" name="number" />';[/php]
This is what is shown in the browser[php]Enter&nbsp;valu e&nbsp;&lt;inpu t&nbsp;type=&qu ot;text&quot;&n bsp;size=&quot; 3&quot;&nbsp;na me=&quot;number &quot;&nbsp;/&gt;[/php]
You have translated that code into an html tag free string. How did you put that code snippet in your own script? Show the code where you put it.

Ronald :cool:
Jan 26 '07 #6
ronverdonk
4,258 Recognized Expert Specialist
I have no idea what you did to the code snippet I sent you. Look at the first HTML part of the script. All PHP code is translated there into some sort of pseudo HTML code whereby the html tags are translated into char representations of the tags, like someone has done an htmlentities command on it before enclosing it into deprecated <font> and <color> tags.

I would say that you have imported it into some sort of IDE. Anyway, that program screwed it really up!

The snippet I send you is still the one you have to use, but do not translate it into something that is not code at alll. Here it is again[php]<?php
if (isset($_POST['number'])) {
header('Locatio n: http://www.towncenter. com/'.stripslashes( $_POST['number']));
exit;
}
else {
echo '<form method="post" action="'.$_SER VER['PHP_SELF'].'" >';
echo 'Enter value <input type="text" size="3" name="number" />';
echo ' <input type="submit" value="Submit value" />';
echo '</form>';
}
?>[/php]

Ronald :cool:
Jan 26 '07 #7
AricC
1,892 Recognized Expert Top Contributor
From reading the first post and joing late it almost looks like you want to name those videos something more descriptive then provide a drop down box with links to different videos. Unless I am missing something.
Jan 27 '07 #8
pipponino
6 New Member
I thought of that for "FEATURED VIDEOS" but I have 500 or so on the system at any one time. They have tour ID's assigned that are on sign riders outside the properties. So they people need to have a box to input the "TourID" I do appreciate the feed back and suggestions. This stuff isn't easy for me and the help really means a lot.

Sincerely,

John



From reading the first post and joing late it almost looks like you want to name those videos something more descriptive then provide a drop down box with links to different videos. Unless I am missing something.
Jan 27 '07 #9
pipponino
6 New Member
Hi Again,

Well I did it. I created a file and all I have in it is the code that you gave me. It is in the same spot http://www.towncenter. com/tourid.php and it gives a blank page... Could this be my server not executing the script correctly?

I have no idea what you did to the code snippet I sent you. Look at the first HTML part of the script. All PHP code is translated there into some sort of pseudo HTML code whereby the html tags are translated into char representations of the tags, like someone has done an htmlentities command on it before enclosing it into deprecated <font> and <color> tags.

I would say that you have imported it into some sort of IDE. Anyway, that program screwed it really up!

The snippet I send you is still the one you have to use, but do not translate it into something that is not code at alll. Here it is again[php]<?php
if (isset($_POST['number'])) {
header('Locatio n: http://www.towncenter. com/'.stripslashes( $_POST['number']));
exit;
}
else {
echo '<form method="post" action="'.$_SER VER['PHP_SELF'].'" >';
echo 'Enter value <input type="text" size="3" name="number" />';
echo ' <input type="submit" value="Submit value" />';
echo '</form>';
}
?>[/php]

Ronald :cool:
Jan 27 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

2
8395
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when submitting the form to update the database. The server doesn't have the client side value any more. It seems to me that as I begin to write the client side javacript code for form validation and client side editing capabilities in order to save...
1
1548
by: Brian Henry | last post by:
Hello, I was tring to learn socket's (being i never used them before) and have a simple question. I want to create a listner that will get any data recieved and print it out. I've been able to get it to recieve only one line of data, but the next one i send to it wont be printed like the 1st one. I had a listner running in a thread, does anyone have a simple listner code example that would show how to have a tcplistner thread running...
4
1430
by: pcnerd | last post by:
I originally asked this question in the "classic" VB forum. It occured to me after I had sent it that I sent it to the wrong forum. Anyway! Here's the situation. I have VB.NET 2005 Express Edition. I have a 19" LCD monitor with the resolution set at 1280 by 1024. I want to create a graphics program, say, displaying fractals that will run with the form maximized. Are the XY coordinates on the form independent of the size & resolution of...
4
118814
by: dba_222 | last post by:
Dear Experts, Ok, I hate to ask such a seemingly dumb question, but I've already spent far too much time on this. More that I would care to admit. In Sql server, how do I simply change a character into a number?????? In Oracle, it is:
14
2977
by: Giancarlo Berenz | last post by:
Hi: Recently i write this code: class Simple { private: int value; public: int GiveMeARandom(void);
30
3522
by: galiorenye | last post by:
Hi, Given this code: A** ppA = new A*; A *pA = NULL; for(int i = 0; i < 10; ++i) { pA = ppA; //do something with pA
6
2323
by: beantaxi | last post by:
Hello all, I'm looking for a very simple code analysis tool. I have a large codebase to analyze, and all I really need to do is to find all uses of all methods in a few interfaces. Many tools (e.g. Resharper) obviously do this internally, but I can't seem to find any that expose this simple functionality. Command line would be fine -- in fact I'd prefer that but its not necessary.
5
1616
by: fussfart | last post by:
I'm trying to do something that should be very simple but isn't working! (I also want to do something somewhat more complicated, but that has to wait until I figure out the simple stuff.) First, I want to call out a .js file from inside a web page to write some stuff. I've done it before, but it's been a while. I've got it ultra-simplified just to try to get it to work. (Once I've got the bugs out, I'm going to put some real code in the .js...
10
2128
by: Phillip Taylor | last post by:
Hi guys, I'm looking to develop a simple web service in VB.NET but I'm having some trivial issues. In Visual Studio I create a web services project and change the asmx.vb file to this: Imports System.Web.Services Imports System.Web.Services.Protocols Imports System.ComponentModel <System.Web.Services.WebService(Namespace:="http:// wwwpreview.#deleted#.co.uk/~ptaylor/Customer.wsdl")_
17
5812
by: Chris M. Thomasson | last post by:
I use the following technique in all of my C++ projects; here is the example code with error checking omitted for brevity: _________________________________________________________________ /* Simple Thread Object ______________________________________________________________*/ #include <pthread.h> extern "C" void* thread_entry(void*);
0
8600
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9021
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8892
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8860
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4614
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
1998
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.