MDanz
-
Posts
728 -
Joined
-
Last visited
Posts posted by MDanz
-
-
The width spreads across the whole page, i only want it to be as long as the content in the div. How can i solve this?
<style type="text/css"> .three { display:block; width:auto; height:100px; position:relative; border:1px solid black; } .three a { width:100%; height:100%; position:absolute; } </style>
echo "<div class='three'><a href='two'></a>test</div>";
-
i've done mod_rewrite on all my links now but i don't want the user to be able to type in http://www.example.com/about.php ,when i have this link already http://www.example.com/about. I want any link with a .php to be redirected to the index page. What rewriterule would accomplish this?
-
nvm i know how to resolve it.
-
thanks i changed it and it works.. but now it my CSS isn't working? it just has the text on a white page. How do i fix this?
-
i've done this
RewriteRule ^([A-Za-z0-9-]+)/?$ profile.php?user=$1 [L]
to make
www.example.com/profile.php?user=testing
into
www.example.com/testing
What i'd like to do is change..
www.example.com/profile.php?user=testing
into
www.example.com/user=testing
What is the RewriteRule to accomplish this? Also if i used $_GET['user'] with the second clean url would it still work?
-
Your clean URL should rewrite all the variables into the messy URL so you won't have to do anything with the $_GET. As for as the PHP script is concerened, it dosn't matter if it was a clean URL or messy.
Forms are a different matter though, the action needs to be the working clean URL (not just 'submit'). If you're using GET forms then it will always look ugly. If you have several fields to submit try using POST where you can have a clean URL as the action, and all of the post data will be hidden from the URL. Depends what sort of data you're submitting in the form.
Thanks for help.
So your saying example.php?name=test and example/name/test.. if i use $_GET['name']; on the clean url it will be "test"?..
and i should change my GET forms to POST(hidden data), for the sake of clean urls?
-
I've recently used mod_rewrite and changed my .htaccess allowing clean urls. Is there a tutorial that tells me how to use $_GET with a clean url?
for instance how do i get the name with the clean url($_GET method)?
messy url
example.com/play.php?id=203&name=test
clean url
example.com/videos/play/203/test
also when using forms is it as simple as changing
<form action='submit.php' action='get'>
to
<form action='submit' action='get'>
or do i have to do something else?
-
onclick of the textarea, it should display the div with "TEST" in it but nothing happens.
<script type="text/javascript"> function popup(number) { document.getElementById('submit'+number).style.display == "block"; document.getElementById('submit'+number).style.position == "absolute"; } </script>
<?php echo "<textarea id='example0' readonly='readonly' onclick='popup(0)'></textarea>"; echo "<div id='submit0' style='display:none'>TEST</div>"; ?>
-
When the function is called it should change the width in div 'add' but it does nothing?
#add { overflow:hidden; float:left; margin-right:5px; border:1px solid black; }
newfield = 0; function add() { if(newfield!=6) { var hundred = 100; var newval = parseInt(newfield)*parseInt(hundred); document.getElementById('add').style.width = newval; newfield += 1; }else { document.form.add.disabled=true; } }
-
when i echo my select query i now get this.
SELECT * FROM test WHERE name='q test\'1' ORDER BY `id` DESC LIMIT 10
in the database i have a row with name = q test\'1 but it isn't retrieving data.
What do i have to change to get the query to retrieve the result.
-
i want if this checkbox is clicked to change the value in the textarea to "Input image url".. the below isn't working though
<input type='checkbox' name='image' onclick='if(this.checked) { image(0);}' />
function image(number) { document.outcomes['reason["+number+"]'].value="Input image url"; }
<form action='submit.php' method='POST' name='outcomes'> <textarea name='reason[0]'></textarea> </form>
-
i tried but i get the internal 500 server error
i put this in my .htaccess file
php_flag magic_quotes_gpc off
-
i'm not getting any results for the query. I'm sure it has something to do with the apostrophe and back slashes
$search = "q test'yes"; $search = mysql_real_escape_string($search); mysql_query("SELECT * FROM block WHERE name LIKE '%$search%' ORDER BY `id` DESC",$this->connect);
When i echo it out i get this
SELECT * FROM block WHERE name LIKE '%q test\\\'yes%' ORDER BY `id` DESC
-
i tried this not working it should limit 'example' to 12 characters
var example = document.getElementById(number).value; var exampleid = "example"+number; var example2 = example.substring(0,12); if(example2.length==12){ var example3 = example+"..."; } else { var example3 = example; } document.getElementById(exampleid).innerHTML = example3;
-
var example = document.getElementById(number).value; var exampleid = "example"+number; document.getElementById(exampleid).innerHTML = example;
i only want the variable 'example' to be 12 characters long then followed by three fullstops.
How do i do this?
-
yes thats what i mean. when i tried that i got the Warning: in_array() [function.in-array]: Wrong datatype for second argument in..
-
i have an array stored in the session.
e.g.
$value=array("50","100");
$_SESSION[50] = $value;
ok how would i revert the session back to the array form. so in_array works.
-
The result should echo 1. $_SESSION[50] is an array.
i keep getting this error... Warning: in_array() [function.in-array]: Wrong datatype for second argument in..
$value="50"; $search = "test"; if(in_array($search,$_SESSION[$value])) { $duplicate = 1; }else { $duplicate = 0; } echo $duplicate;
-
when i upload to the server the file is in public_html/example.com/about.php
but on the domain address it is http://www.example.com/about.php
-
.htaccess file is in my public_html directory and about.php is in a folder in my public_html directory.
-
ok i changed it and i typed http://www.example.com/about and i still get the 404 not found error
RewriteEngine On RewriteBase / RewriteRule ^about$ /about.php [L]
any idea what could be wrong?
-
i'm trying to get a clean url for my about page.
i want to change
http://www.example.com/about.php
to
i put my htaccess file as this
RewriteEngine On RewriteBase / RewriteRule ^(.+)/([0-9]+)/?$ about.php
it's not working though, i get the 404 not found error.
-
i get these two errors
Warning: mysql_close(): 5 is not a valid MySQL-Link resource in ..
Warning: mysql_close(): 4 is not a valid MySQL-Link resource in ..
How do i solve these errors?
it's on this line
mysql_close($this->connect);
theres nothing wrong with the line
-
Onchange of the dropdown list, the textfield should display either "testing 3" or "testing 4" but nothing is happening.
<form action='submit.php' method='POST' name='form'> <select name='preset' onchange='preset(this);'> <option value='test1'>testing 1</option> <option value=test2'>testing 2</option> </select> <input type='text' name='big[]' value='' /> </form>
function preset(ele) { if(ele=="test1") { var action1 = "testing 3"; } else { var action1 = "testing 4"; } document.form."big[0]".value = action1; }
slideshow stop button help
in Javascript Help
Posted
here is the code for the javascript slideshow
how do i stop the slideshow onmouseover?
i tried
... but it never worked.