-
Posts
3,584 -
Joined
-
Last visited
-
Days Won
3
Everything posted by JonnoTheDev
-
Not sure if this is possible without the actual remote file location. The remote script is obviously using a file header to prompt a download
-
This could be a difficult task dependent on how you will display the data in the browser. You may need to set tags around each piece of data you are saving in the file so you can extract it correctly using string functions or regex. i.e. // text file [TITLE]This is the title[/TITLE] [bODY]This is the body[/bODY] The basics of this are to first validate the user input. Then store the data into a file using file(), fwrite(), etc. Retreiving the data may again involve the use of file() or file_get_contents(), etc Then you will need to break the file contents up into how you want to display it on screen. Maybe use some string functions to build up an array of the content parts in the text file.
-
I find it better when using an ENUM field to use 1 & 2 rather that 0 & 1 as the code will see 0 as empty i.e. // $flag == 0 if(!$flag) { // display } // $flag == 1 else { dont display }
-
delete child records when deleting parent record
JonnoTheDev replied to suyesh.amatya's topic in MySQL Help
You can either run 2 queries or use a foreign key constraint (you will need to alter the blog table) since you are using InnoDB tables. Read http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html -
If forms are involved you will ned to use CURL for this.
-
PHP/Mqsql problem, data not being inserted!
JonnoTheDev replied to samf_20's topic in PHP Coding Help
This means that $_SESSION['details']; is not an array when it should be. -
Is your form actually submitting? Can you print the user entered input to the screen after the form has been posted to test. Also your mail function is missing the mail headers. Check out the mail() function on php.net for a description of mail headers.
-
PHP/Mqsql problem, data not being inserted!
JonnoTheDev replied to samf_20's topic in PHP Coding Help
This is incorrect. You do not implode in a loop $ilm = $_SESSION['details']; foreach($ilm as $value) { $str = implode(',' , $ilm); echo $str; } foreach($ilm as $value) { $insert="INSERT INTO dealerguide (ilmissue) VALUES ('$str')"; } mysql_query($insert); Should be $insert="INSERT INTO dealerguide (ilmissue) VALUES ('".implode(",",$_SESSION['details'])."')"; mysql_query($insert); -
If you have no experience writing bots then I recommend this book: http://nostarch.com/webbots.htm If you have no php experience then I suggest a beginners php book also.
-
Problem passing data from php to mySql database - help!
JonnoTheDev replied to Chezshire's topic in PHP Coding Help
What does this mean? -
Are your mail headers correct? text/html
-
The --with-xsl is when you are compiling php from source. If php is already compiled then your can either recompile (check with phpinfo(); to see what other modules have been included) or add the package with yum (linux): From the linux command line: yum install php-xsl Then restart apache
-
Is session support enabled in your php configuration? Is you session save path correct?
-
How can you suggest this guy can't do it. There has been no complete specification posted. You could make a simple app in a couple of days, easy!
-
My code randomly stopped working...what gives?
JonnoTheDev replied to Kane250's topic in PHP Coding Help
Has the user upgraded their web browser. Your javascript may be out of date. -
What do you need to know?
-
The cookie needs to be stored in a directory that can be written to. You dont seem to have supplied a path i.e. curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookie.txt"); curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookie.txt"); So no cookie, no login!
-
how to detect what browser your visitor is using
JonnoTheDev replied to eleven0's topic in PHP Coding Help
What happened to accessibility! Would you stop a blind person accessing your website from a speech based browser because they are not using IE 7 or the latest Firefox? -
All WHM functionality, creating accounts, dns records, subdomains, etc are basically done via perl files in the core of the system. The API will call on the files dependent on what you are doing i.e. createAcct() - create an account. If the API has no method for creating subdomains then you will need to extend the API to do this. Not sure what version of WHM it was at the time but I extended the API to allow more functionality via remote calls. This was for a webhosting company who used WHM servers for customer hosting that wanted to give the users more control over their hosting accounts via the company website and strip the functionality away from the cPanel system. You will need to research this yourself as its not a case of posting a bit of code here to make it work for you. At the time I dont think the documentation gave much info on the API itself so it was a case of figuring it out.
-
[SOLVED] Little help with a regular expression
JonnoTheDev replied to Wolphie's topic in PHP Coding Help
Look at the original regex that started the post off kratsg! -
[SOLVED] Little help with a regular expression
JonnoTheDev replied to Wolphie's topic in PHP Coding Help
Here is a description of your original regex: Part 1: [] Match a single character in the range between A and Z Match a single character in the range between a and z Part 2: [] Match a character in the list below between 0 and 70 times, as many times as possible, without giving back (possessive) Match a single character in the range between A and Z Match a single character in the range between a and z Match a single character in the range between 0 and 9 -
The best way to stop multiple records being inserted on a page refresh is to reload the page after the insert query has run so: // insert the record mysql_query(""); // redirect the user header("Location:page.php?booking=true"); Then you can check for the $_GET['booking'] and display the user success message