|
Check your firewall allows access through port 80 (http) and 443 (https).
|
|
|
|
|
Hi all
i would like to write an on click/submit event on a button and im doing it like this
<form name="form1" action="" method="post">
<input type="button" name="mybutton" onclick="<?php print "my Test"; ?>";
form1.submit()">
</form>
i know onclick is a javascript function,does anyone know what's the equivalent in PHP.
Regards
|
|
|
|
|
JavaScript runs at the client side, where the button is.
PHP runs at the server, and is unaware of someone clicking a button at the client side.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Right, basically there is no equivalent.
PHP runs before the client sees the web page and only on the server. Javascript/VB run on the client side (browser) after the page has been processed by the PHP. That is why it is called PHP Hypertext Pre-processor.
|
|
|
|
|
<?php if($_POST['submit']){
echo "form submitted";
} ?>
<div id="mydiv">This is a div contents</div>
<form name="form1" action="" method="post">
<input type="button" name="mybutton" id="mybutton" onclick="document.getElementById('mydiv').innerHTML = 'my Test'" value="fill div" />
<input type="submit" value="submit" name="submit" />
</form>
The above code shows the difference between javascript & php. Javascript works on the page on the client side ("fill div" btn does not refresh the page). When you "submit" the form the contents of it are sent to the server. There the server sees that a form has been submitted and formats the page as required ( here it writes "form submitted to the beginning of the body text before sending it back to the client).
|
|
|
|
|
HI, how do I force the submit of a form in Perl?
I wanna make a script that sends data, through "form style", without the "click-submition-button" part
|
|
|
|
|
|
|
|
Cool. I'll have to give it a go.
|
|
|
|
|
The adaptive compilation is pretty good and improves speed on my apps (subjective!)
Cheers,
|
|
|
|
|
Hi friends,
I am a beginner in php...i am in a problem.i have to use forums in my project..i haven't get any idea
how to do this..is there any third party tool or something like that for this..or we have to code ourown way..can anybody help me or suggest me for this...i need your sincere help....
regards
alex.
|
|
|
|
|
phpBB[^] is a free php-based forum software that you (should) be able to download and install in a few seconds...
|
|
|
|
|
THANKS I WILL CHECK IF IT WORKS FOR ME OR NOT
|
|
|
|
|
Hi..i downloded phpbb3 in my pc..still i have a problem..i can't integrate that with my project..do u have anyidea about how phpbb3 is installed or implemented in our own websites..help me...
thanks in advance.
|
|
|
|
|
See the thread you created right after posting this.
|
|
|
|
|
hi
i am new to linux os. i want to install emax.
i have downloaded the tar.gz files. the how to install these file
by
paul
|
|
|
|
|
Start by unzipping the tar.gz, then there should be a text file called INSTALL or README or somthing like that that will give you detailed instructions on what to do.
If your distro has a package manager available it'd be better to use that to install stuff than to do it manually.
|
|
|
|
|
I'd be surprised if you don't already have it installed. try running it from a terminal
|
|
|
|
|
hi there,
my rewriterule with a condition is working fine as below:
http://www.sitename.com/index.php?n=text redirects to
http://www.sitename.com/pages/text with a little problem explained below.
and the page renders properly, however, there is a problem that with the redirected URL the arguments are also added to the URL. So actually in address bar it looks like-
http://www.sitename.com/pages/text?n=text
This is bugging me. The part '?n=text' should not come. Could anyone help me on this? The htaccess code is given below.
RewriteCond %{QUERY_STRING} ^n=(.*)$
RewriteRule index.php http://www.sitename.com/pages/%1 [r=301,nc]
Thanks in advance!
Aditya
Aditya
modified on Monday, March 30, 2009 1:11 AM
|
|
|
|
|
I'm afraid I cant help you with the Rewrite rule. But seeing as you are using PHP couldn't you just use that?
<?php
header ("Location: http://www.sitename.com/pages/".$_GET['n']);
?>
Neonlight
|
|
|
|
|
hey neonlight,
that seems to be a nice suggestion, thank you! however, i have got the problem fixed in htaccess itself.
modified code is -
RewriteCond %{QUERY_STRING} ^n=(.*)$<br />
RewriteRule index\.php http:
cheers,
adi
Aditya
|
|
|
|
|
hidden (htaccess rewritten) URL (X) - www.sitename.com/index.php?id=123
actual url (Y) - www.sitename.com/index/id/123
so far the URL X is used, but for security and url cleaning i want to use the URL Y
I want to know - should i place a permanent redirect for the URL X that is so far cached by search engines? Is that preferrable? I want to update the World with the URL Y. and want to remove the URL X frm internet world.
I am also concerned regarding the page ranking that the URL X have gotten so far.
i hope i am clear with the question.
any suggestions would be appreciated!
thanks
Aditya
Find tips and tricks on http://www.easytipsandtricks.com
|
|
|
|
|
hello,
if a website has its address like -
www.name.com/index.php?name=a-ab-abc
depending upon the value of the parameter 'name' the contents in the website are displayed. If name value is invalid or not in database, php script INCLUDES an error-message php file in the same index.php?name=a-ab-abc stating that its a 404 page not found. However my concern is how the search engines treat this like? Does it treat the page as same 404 page not found or it treats as normal page?
cheers
Aditya
|
|
|
|
|
I think if you uploaded a sitemap and informed google of it using webmaster tools, it would index your site ok.
If you are refernceing pages stored in a DB: I've had this issue come up before and never really found a solution - I tend to make an actual page for every page now and use a sitemap where neccessary.
If the pages actually exist but naviagtion is completed through queries (not hyperlinks) - the engines will find it harder to 'weigh' your pages - but the sitemap will help it find them and weigh them. It's a start.
As for the code as long as a page is found it should return 200. However you can send custom headers (ie 404 for missing pages) using php. Look up "header" in the php manual.
|
|
|
|