-
Posts
3,584 -
Joined
-
Last visited
-
Days Won
3
Everything posted by JonnoTheDev
-
PHP and XML API interface question (design)
JonnoTheDev replied to leart's topic in Application Design
Zend_Http_Client is basically CURL. The package has the same function. Why would you need the entire zend framework to make an HTTP request. This is so simple and is no way dirty. You are making a bit of a mountain out of a molehill. Process 1. User submits the form 2. Send the input via a HTTP POST/GET request to API url 3. Parse the XML response via SimpleXML 4. Act on response and display results to user Why do you need to even use AJAX for this? Most simple API's are called via GET/POST requests in whatever fashion, they simply return a response. If an API uses a WSDL then you would use SOAP to make the requests. -
[SOLVED] how to use php functions within echo
JonnoTheDev replied to pouncer's topic in PHP Coding Help
echo "<table border=0><tr><th bgcolor=#E1E4F2>RSS Feeds ".getTotalLinks($rss_table)."</th></tr>"; -
test site stored and personal member site
JonnoTheDev replied to gwolff2005's topic in Application Design
You would select the members data from the database in order to display a personal greeting. You need a good database design to store the test input. Use the member id as the foreign key against the test result so you can join the member to the test data. To keep the data persistent through the pages of the test use sessions. You should already be using a session to check that the member is correctly logged in. -
PHP and XML API interface question (design)
JonnoTheDev replied to leart's topic in Application Design
You can send the post/get data to the API via CURL. Then you require a parser to parse the XML response. This is quite simple. Read up on CURL and SimpleXML -
Font used doesn't look good. The brand images are of a poor quality. The black menu bars on the left nav don't look like they are actual links. Your modular headings should be more obvious to split the areas up - brands, news. The overall design doesn't look like a hardware store theme but I can see you have a lot left to do. Use proper CSS for layout and validate your HTML through W3C
-
100% stretch works better than 760 centered for forums in my opinion as there is obviously less wordwrapping.
-
Yep. If I were you I would convert that video to flash and dont use autoplay. Let the user play the video if they wish. It is more than likely the video that is slowing it right down.
-
Not keen on the header banner. Its far too big and pushes the posts away from eye level. Every time you click you have to scroll down to read the posts.
-
http://www.imagemagick.org/script/index.php
-
http://www.fckeditor.net/
-
Takes ages to load up
-
Quick Question - mysql response times
JonnoTheDev replied to johnsmith153's topic in PHP Coding Help
Can you post the query -
Get a CSS book or go through some tutorials. http://www.davesite.com/webstation/css/
-
Simple SQL connecting to 2 databases at same time
JonnoTheDev replied to johnsmith153's topic in PHP Coding Help
Try persistent connections $db1 = mysql_pconnect($host,$user,$pass); $db2 = mysql_pconnect($host,$user,$pass); mysql_select_db("db1",$db1); mysql_select_db("db2",$db2); -
Simple SQL connecting to 2 databases at same time
JonnoTheDev replied to johnsmith153's topic in PHP Coding Help
Are the databases on the same server. You dont have to open 2 connections if so, you can prepend the table name with the database name: mysql_query("SELECT * FROM db1.tablename ",$conn); mysql_query("SELECT * FROM db2.tablename ",$conn); Just dont use mysql_select_db() -
http://csscreator.com/?q=tools/layout Whats with the mass of non breaking spaces in your HTML?
-
Always, always, always check that the variables you test in conditions contain the expected values by simply printing them to the screen prior to posting your code for review! If the data is contained within the reserved variables $_POST or $_GET use: print_r($_POST); exit();
-
<td align="center" valign="top"> On another note you should be using CSS for layout. This HTML is old and outdated.
-
Ooohhh. If we show you how to do this you won't really learn will you. A pointer for you: URL Parameters index.php?layout=1 index.php?layout=2 index.php?layout=3 $_GET
-
session_register() is obsolete and should not be used at all. Once your user has logged in correctly set a session to true. i.e. // user has logged in correctly $_SESSION['authorised'] = true; On the page you want to check that a user is logged in: if(!$_SESSION['authorised']) { // redirect to login header("Location:login.php"); exit(); } On your logout page destroy the session value: unset($_SESSION['authorised']);
-
You should also place this in a function as you are using the same test 3 times if (preg_match("/http:\/\//i", $message)){ header("Location: error.php"); exit(); }
-
Then do some debugging. Check these variables contain the expected data $from = $_POST['email']; $sender = $_POST['name']; $message = $_POST['body']; Remove the else statement at the end of the script also as lonewolf has stated
-
because you are using elseif and else conditions. you dont need to. compare the 2 scripts again. if you are using exit() then the script terminates so there is no requirement for else or elseif
-
[SOLVED] Curl not retrieving image properly
JonnoTheDev replied to scottybwoy's topic in PHP Coding Help
Run as a background process, not through a web browser if slow. Should not really be slow, are you sure it isn't the remote site or your internet connection? -
Automatic script execution through proxy server
JonnoTheDev replied to JonasLAX's topic in PHP Coding Help
Use CURL as you can set a proxy address i.e. curl_setopt($ch, CURLOPT_PROXY, "ip:portnumber"); // if authenticaton is required curl_setopt($ch, CURLOPT_PROXYUSERPWD, "username:password"); http://uk.php.net/curl As far as free proxies just search Google, you will find loads. However they are not always reliable and get abused. Better paying for private addresses.