0x00
Members-
Posts
120 -
Joined
-
Last visited
Everything posted by 0x00
-
Not using either cms i'm not positive as to how is best way to proceed. However, a) You store a copy of the location to start off with, then put it back after. However I don't see the point, it's just a variable. or b) If everything can be directed as being relative to current location then you can get that by truncating $_SERVER variables such as 'REQUEST_URI', 'SCRIPT_NAME' or 'PHP_SELF'... (Not currently at a pc with php capability and none usual resources). My first thought as reading your post was to have a wrapper function to handle the differences between two cms's...
-
You could store the details from page one in either: a) session variables b) in the db linked to a session id To add a physical back button you could use js, otherwise just print a link/button(sm form) which points back to the previous page with a title of your choice.
-
Silly question, but are you getting the 'image' name before deleting the entry, e.g. why didn't you just show the new code? After that check permissions, (e.g. if you created the images you should be able to delete them!) refs: http://us3.php.net/manual/en/function.fstat.php, see 'mode' http://us3.php.net/manual/en/function.chmod.php
-
For some reason there's code tags in forums... (they look like '#') P.S. When debugging, build your form, then when you receive the data print it out, then send it. This way you'll know at which point the problem is occurring!
-
First you need to connect to the db (*use your own details here: // CONNECT TO MYSQL $conn = mysql_connect($db_host, $db_uname, $db_pass); $res = mysql_select_db($db_dbname, $conn); Then try something like this: $query1="SELECT * FROM settings"; $result=mysql_query($query1); $name=mysql_result($result, 0, ''chatroomname"); See http://uk3.php.net/manual/en/function.mysql-result.php, for details... Also, when posting it's usually good to post the actual error...
-
Top banana, makes sense that does arh! Cheers!
-
Array_unique - how-to get first item value in repeated array item
0x00 replied to mapg's topic in PHP Coding Help
If you have a box, you can put things in this box, yet when you do the thing that was in it previously gets replaced by the new thing. Therefore every time you tell the associative array that there is a new element to be put in a named position, it replaces it totally. Try this to see what I mean! $array_test = array('111' => 'first one', '111' => 'middle one', '111' => 'last one', '222' => 'first one', '222' => 'last one', '333' => 'first one', '444' => 'first one'); echo $array_test['111']."<br><br>"; while (list($k, $v) = each($array_test)) { echo "".$k.": ".$v."<br>"; } -
Here's my version... echo ("<a href=".$zeb." onclick='window.open(".$zeb.",'popup','width=440,height=290,left=165,top=140'); return false'><img src=".$ICON." border='0'></a>");
-
In the following example, why can you not iterate through the array twice, yet still access it directly later? <?php $data = array(); $data['one'] = 1; $data['two'] = 2; $data['three'] = 3; while (list($k, $v) = each($data)) { echo "".$k.": ".$v."<br>"; } echo "<br><br><br>"; while (list($k, $v) = each($data)) { echo "".$k.": ".$v."<br>"; } echo "<br><br><br>"; echo "one: ".$data['one']."<br>"; ?>
-
Do something like this, then write out line by line... $1 = $fname; $1 = str_pad($1, 44); $1 .= $lname; $2 = $street; $2 = str_pad($2, 39); $2 .= $city; $2 = str_pad($2, 54); $2 .= $state; $2 = str_pad($2, 57); $2 .= $zip; $3 = $tel; $3 = str_pad($3, 10); $3 .= $fax; However what would happen if I lived here 'Llandrindod Wells'?
-
[SOLVED] Replace one color with another in an image?
0x00 replied to kernelgpf's topic in PHP Coding Help
Surely your virtually there... http://uk3.php.net/manual/en/function.imagesetpixel.php -
I'd use '$sret .= ' instead of 'echo', then you can print it wherever you want!
-
I presume that it'll be user specific (since apache runs as a user) so '/usr/local/bin' should take preceedence, but it's been a while since LFS... ???
-
Try this to check the server vars: while (list($k, $v) = each($_SERVER)) { print "'".$k."' => '".$v."' <br>"; }
-
Can anyone tell me what characters are valid for the second set of characters in the 'outward code' section of a London postcode? To illustrate, this is a typical UK postcode: SW1 1ZZ Here is the postcode for 10 Downing Street: SW1A 2AA As you can see there's an extra 'A' in the first section, i've also found 'B' (WC2B ***) in some case's. However I can't find a definitive list of valid characters, can you? Here's what my regex look's like so far: if(preg_match("/^[A-IK-PR-UWYZ]{1}[A-HK-Y]{0,1}[0-9]{1,2}[A-Z]{0,1} {1}[0-9]{1}[ABD-HJLNP-UW-Z]{2}$/",$e)) { $res = "Valid"; } As you can see i've used A-Z, but from some checklists i've got it validates invalid codes, such as 'GB7Z 1HQ'. Also note that this currently only handles uppercase characters!
-
Oh yes... there's some good stuff there, mmm what's the expression? Buzzin!
-
In essence it's really postcodes and phone numbers. I found this which is a good example for GB (http://www.ml-consult.co.uk/foxst-39.htm), but am searching for others. I've also found some references to the formats for other countries, whilst wiki has come up trumps for dialing codes and number formats. I'm just looking for the esay option, but quite happy to do it, prolly post it on 'PHP Freaks Forums > PHP and MySQL > FAQ/Code Snippet Repository' when I finish...
-
Wait until iframe finish loading, then resume code
0x00 replied to everisk's topic in PHP Coding Help
Do you realise how php works? When php echo's or print's, it put's this on the file stream that is being returned to the client browser, therefore the iframe statement won't be executed untill it is client side... You could use php to read the file and dump it to the client inline, or maybe use some form of javascript on the clientside... -
this is on my list, as for php i'm not so sure but i've been looking into bcompiler for faster loading times for large sections of code. I read something somewhere about mysql benchmarking, but it wasn't just running the standard benchmark, however i can't remember what it was called. But i've just been looking into this: http://dev.mysql.com/doc/refman/5.1/en/log-files.html, and am considering the general query log. If need be i'll write a script that'll use wget every minute to call each page individually so that i can pigeon hole the results (no request should take longer than 1 min!). Hope this helps... Oh for php, if you do some dfd's and sort of identify the big blocks you could then setup your own benchmarking echoing microtime() string's (http://uk3.php.net/manual/en/function.microtime.php).
-
Hi, i'm after some information on validating address's from everywhere, probably postcode and telephone numbers are most important. Could someone show me a list of how each country formats theirs, even better for an example with php n regex. I've done some googling, but it left me dangling with many pay services which look up for you, but i don't really need that level so... Cheers in advance!!!