-
Posts
3,584 -
Joined
-
Last visited
-
Days Won
3
Everything posted by JonnoTheDev
-
$_SESSION['varibleName'] = $_POST['variableName']; replace variableName for whatever post value you want in your session and remember to include session_start() at the top of every file using sessions.
-
Doesnt really matter if on same host because you are using a URL rather than a filepath. If URL file opening is allowed on your server you can use: $handle = fopen($row['picgal'], "r"); while (!feof($handle)) { $contents .= fread($handle, 8192); } fclose($handle); echo $contents; Other than that you can use a standard include(); so: include($row['picgal']); If fopen on URLS is not allowed then you would need to use CURL http://uk2.php.net/manual/en/book.curl.php
-
All you need is: if(!strlen($trimmed['gender'])) { // no gender selected - display error }
-
You mean grab the contents of the page from the external link?
-
Also the way you are tackling this there is no requirement for a class. A general function would be more efficient on its own function make_form($form_title,$form_name,$action,$form_elements_array){ echo "<form name=$form_name action=$action>\n"; echo "<table><tr><td><h3>$form_title</h3></td></tr>\n"; foreach($form_elements_array as $val){ $element=$val."_form"; echo "<tr><td>$val</td><td><input name=$val</td></tr>\n"; } echo "<tr><td colspan=2><input type='submit'></td></tr>\n"; echo "</table></form>\n"; } will do
-
You are not setting the class variables and referencing them with $this. You can either add a constructor method or remove $this in your make_form method so: option 1 public function __ construct($form_title,$form_name,$action,$form_elements_array){ $this->form_title = $form_title; // rest of vars } or in you make_form method change the foreach to foreach($form_elements_array as $val){ } You do not need the member variables if you use option 2 so the following can be removed: private $input_name,$input_type,$form_name,$input_title,$form_title,$form_elements;
-
$_POST['client']; or $_POST['user'];
-
quick simple retrive external xml (to cache on server)
JonnoTheDev replied to knowj's topic in PHP Coding Help
You can simply use the file_get_contents() function to grab the feed and then add some parsing code to format it or use an existing class like http://www.phpclasses.org/browse/package/1820.html -
I think this maybe possible if you are using the Skype service
-
Tell her to take a look at this http://www.nads.org.uk/clubs.php This is a website I developed to promote the disabled facilities of football (soccer) clubs in the UK. Click on any of the clubs and then click the Getting There link near the top. i.e. http://www.nads.org.uk/portsmouth-fc/fratton-park/location/32.html http://www.nads.org.uk/arsenal/emirates-stadium/location/2.html This uses the Google API and they know exactly how much usage we have of the maps because the key they give you works only on the specified domain. We have 0 issues with any websites using maps.
-
class myClass { public $i; public function __construct() { $this->i = 5; } public function i() { // method code return 2; } } $x = new myClass(); // will set $y to 5 $y = $x->i; // will set $y to 2 $y = $x->i(); See the differences above. The first is a ref to a class variable. The second is a class method
-
Get the first common line of a file using preg_match
JonnoTheDev replied to siddscool19's topic in PHP Coding Help
What the hell? This is an example: $subject = "I am a good boy 34."; preg_match('/([0-9]+)/', $subject, $match); It obviously needs to be modified so each line that is read in from the file is passed into the regex to extract the number. $subject is used as an example -
Get the first common line of a file using preg_match
JonnoTheDev replied to siddscool19's topic in PHP Coding Help
Incorrect. Use: $subject = "I am a good boy 34."; preg_match('/([0-9]+)/', $subject, $match); echo $match[1]; -
Not really - where did you get that idea
-
Why? Its basic SQL syntax
-
Rather than using a * in your SELECT statement (which is everything), only select the fields you want to return. SELECT field1, field2 FROM.....
-
You are better redirecting the user to a success page with a header command after the email has been sent header("Location: successpage.php"); If you add HTML under the mail() function and the user hits refresh then the email with get set again, and again, and again........
-
You will have to modify the database (if your results are from a database) query to only get you the number of results based on the page parameter i.e. mypage.php?page=x What has XML got to do with pagination?
-
To be honest it doesnt matter if the key is decrypted. It is only used to perform a database lookup. You are only generating a unique key per user to be attached to a url param. You could create it from the current time: $userKey = md5(time()); Decrypting it would give you nothing secret!
-
Get the first common line of a file using preg_match
JonnoTheDev replied to siddscool19's topic in PHP Coding Help
Your post doesnt really make sense. Are you trying to extract the first line of the file i.e Or the numeric value within the first line i.e. 23 or something else? -
Then you need to post in Third Party Scripts or get support from PHPFox. You probably won't find help here.
-
What Mail Agent? How are you sending emails?
-
Bad syntax. Should be: header("Location: mypage.php");