ToonMariner
Members-
Posts
3,342 -
Joined
-
Last visited
Everything posted by ToonMariner
-
I prefer where possible to break out of php for html. This is purely down to preference but I find it helps in various editors to distinguish code. That said there is nothing wrong with what you have. Its all down to preference - pick one style and stick to it; the best option is one that makes your code easy to read for other people...
-
Source code being displayed in browser. Please help!
ToonMariner replied to paulieo10's topic in PHP Coding Help
you appear to not have php available on these servers or you file extension is not .php ( or what ever the server is configured to parse as php) -
you should use single quotes to identify an array index (if its a string that is and i your case it loks to be. $voteinfo must have been an array initially check its NOT an object. if there is only one value in there it may retun as a scalar value and not be an array at all so you must check that it is an array first. (use either count() or better is_array()) if its just a scalar then you must make an array otherwsie your code should work.
-
I think the guy is looking for variable variables.... http://uk.php.net/manual/en/language.variables.variable.php and what he is trying to achive all lies within the first loop so this should do the trick... $var = "variable$num"; for($num=1;$num<=10;$num++) { $$var = "multipleSomethings" . $num; } you will have to adjust the code after that to reflect the variable names accordingly.
-
OK well its good prectice to give your form inputs a label so lets use that to do your check boxes. change this line echo "<input type='checkbox' name='driver'value='$drid'>$name $salary"; to this echo '<label class="chkbxlbl"><input type="checkbox2 name="driver" value="$drid"><span>' . $name . ' ' . $salary . '</span></label>'; (APOLOGOES for switching single and double quotes but I like to see double quotes in html...) in you css... label.chbxlbl { display: block; width: 100%; } label.span { display: block; width: 90%; text-align: right; }
-
ONly way to do this is the old faux column method idf you want cross browser compatability... http://alistapart.com/articles/fauxcolumns/
-
not if it aint in the html..... [sighs]
-
Err yes - it does look funny when post a comment saying 'here's where you went wrong' and then to prove your point that your propositions work you have to revert to the code you said was wrong.... But hey we all have bad days.
-
have a session var for timestamp of last check and just run every 5 mins or so...
-
trecool? What you posted won't do anything. You need a SUBMIT button to actually send the headers. In order to use a BUTTON you would nee some javascript just like what I said before...
-
not in FF - that doesn't allow local access - but why would you want to? The remote server can't check you have the right file path so its not really a useful tool.
-
they will always be able to find it somewhere - if someone really wanted your image they will get it. If this is a case where you are selling an image then you should put a water mark on it so they only get the actual image on payment.
-
I think you are mis-understanding... If you want a website that anyone can visit and it will read their harddrive, you can't (nor should you be able to). If you had the site based on your very own machine - so everything was local - apache & php running on your pc and you only wanting to access your pc then it would be possible.
-
id must be unique for any element on a page - once it has been used it can't be used again. If you are using this to style the input then alter it to a class.
-
Not sure about available scripts to do that - sure there are some - but it is not a major development by anymeans - perhaps its worth placing in the freelance section...
-
bottom line is you can't. You can put javascript in to stop the right click working but then you should use javascrip to write the image tag to teh document so that it deosn't appear if they have javascript off. as soon the path is visible though they can just go and put that in th eaddress bar and they have it. There are methods of hiding the path but its a long time since I have used them and can't remember where the examples are.
-
[SOLVED] 1 Array + 1 Function + 1 Calculation = 1 Big Headache
ToonMariner replied to tcollie's topic in PHP Coding Help
you need either $cash = 1000; print_r(market_max($cash)); or $cash = 1000; $max = market_max($cash); print_r($max); -
I have had very little experience with access but from what I gather it cannot multi task and is MUCH slower than mysql. As for code, zend studio has a whole library of php code that you can just drag and drop into your scripts - I don't particularly like it but if you need a fast learning curve then I would try to get hold of a copy on the cheap...(not advocating piracy but its too expensive for just for the php enthusiast)
-
if you have php5 then the incredibly simple SimpleXML is for you http://uk.php.net/manual/en/ref.simplexml.php. If not then the DOMXML is pretty good - although you need moer understanding of OOP and the DOM for that. http://uk.php.net/manual/en/ref.domxml.php Personally I don't like having php in xml files due to the problems with short tags for php, this also affects portability. Just create the xml files using php and clean them out when they are done with.
-
Yes but only if you tell what the problem is. It will very likely be the configuartion of the server so if you have access to the php congi file see what SMTP is set to or use ini_get('SMTP'); you can use ini_set('SMTP' , 'host'); to set this correctly where 'host' is the relvant smtp server.
-
[SOLVED] Why doesnt this script register a session?
ToonMariner replied to JJohnsenDK's topic in PHP Coding Help
<? session_start(); if(isset($destroy)) { session_unset(); session_destroy(); } else { if(!is_set($_SESSION['name'])) { $_SESSION['name'] = "Spike"; } } ?> <p>SESSID: <?php echo session_id(); ?> <p>Navn: <?php echo $_SESSION['name'];?> <form action="session2.php" method="post"> <input type="submit" name="reload" value="Genstart session"><br> <input type="submit" name="destroy" value="Stop session"> </form> short tags for php should be banned!!!! -
You have to do some ajax if you want php to validate the form inputs.... Same as asp - take each field and apply your validation terms to them - if they match the criteria then ok if not return a fail and use the return string to dictate what js will do to the page. Can't be any more specific as there are lots of ways to go about form validation you have to pick that for yourself.
-
the config setting of interest is session.cookie_lifetime which you can set using ini_set('session.cookie_liftime' , X); where X is the number of seconds you want the session to last (0 = as long as browser is open and is default setting) or session_set_cookie_params as described here: http://uk.php.net/manual/en/function.session-set-cookie-params.php. to check the setting use session_get_cookie_params();
-
that eye still moves on my machine
-
How can I tranfer data using PHP and SSL?
ToonMariner replied to mesh2005's topic in PHP Coding Help
You transfer data the same way as usual. Depeending on how your server is configured you eithe have to place your secure pages into a folder that is attached to the ssl certificate or simply add the s on the end of http.