1,075,725 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

Posts by meisjen

Hey thanks for replying. Sorry I had midterms, didn't get a chance to respond sooner. So I'm working on it again, I saw your last post. I'm not quite sure how to implement this with what I have...

when I try my page is blank on load. I also tried adding the action and you are right it must not matter because it still doesn't turn any results.

I appreciate any help you can continue to offer.

meisjen
Newbie Poster
7 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

I apologize, I didn't say did I lol.

Well, I get the desired form, but when I press the button to search, it just returns a blank page. I know the api must work because when I remove the form and its query elements, it prints out information. I attached a picture of what I get without my form attempt.

Attachments Fullscreen_capture_10112011_81936_PM-3.jpg 83.56KB
meisjen
Newbie Poster
7 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Hey guys,

I was hoping to get a little insight on this issue. I recently signed up for Yahoo Boss v2, I'm not really experienced with PHP. I honestly would have used google's api but they are charging too much for the amount of searches I'll need for this project. From my understanding Google is a little more plug and play. I assumed Yahoo would be too, but it's not.

The guide gives a sample api code here:

<?php  
    require("OAuth.php");  
       
    $cc_key  = "your consumer key here";  
    $cc_secret = "your consumer secret here";  
    $url = "http://yboss.yahooapis.com/ysearch/news,web,images";  
    $args = array();  
    $args["q"] = "yahoo";  
    $args["format"] = "json";  
       
    $consumer = new OAuthConsumer($cc_key, $cc_secret);  
    $request = OAuthRequest::from_consumer_and_token($consumer, NULL,"GET", $url, $args);  
    $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $consumer, NULL);  
    $url = sprintf("%s?%s", $url, OAuthUtil::build_http_query($args));  
    $ch = curl_init();  
    $headers = array($request->to_header());  
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);  
    curl_setopt($ch, CURLOPT_URL, $url);  
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);  
    $rsp = curl_exec($ch);  
    $results = json_decode($rsp);  
    print_r($results);  
    ?>

I'm trying to attach a form to call on the API to return results. I have tried everything, I'm not sure what I'm doing wrong. My attempt is below... can anyone give me some idea? or help me solve this? Thanks in advance

<?php if ($_GET['s'] == '') { ?>
<form method="get" style="margin-bottom:30px; margin-top:20px;">
<input type="text" name="s" size="30" /> <input type="submit" value="Search" />
</form>

<?php } ?>

    <?php  


    require("OAuth.php"); 
    if ($_GET['s'] != '') {
    $thequery = urlencode($_GET['s']);
    $cc_key  = "PUT KEY HERE";
    $cc_secret = "PUT SECRET HERE";
    $url = "http://yboss.yahooapis.com/ysearch/news,web,images";  
    $args = array();  
    $args["q"] = "yahoo";
    $args["format"] = "json";  
       
    $consumer = new OAuthConsumer($cc_key, $cc_secret);  
    $request = OAuthRequest::from_consumer_and_token($consumer, NULL,"GET", $url, $args);  
    $request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $consumer, NULL);  
    $url = sprintf("%s?%s", $url, $thequery, OAuthUtil::build_http_query($args));
    $ch = curl_init();
    $headers = array($request->to_header());  
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);  
    curl_setopt($ch, CURLOPT_URL, $url);  
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);  
    $rsp = curl_exec($ch);  
    $results = json_decode($rsp);  
    print_r($results);
  }

?>
meisjen
Newbie Poster
7 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Okay obviously I was confused and thought the OP meant photoshop cs4, that's my error. I'm just trying to help.

In any case OP I guess you mean Dreamweaver, if you are just trying to center information in your webpage you can simply use center tags in the body.

<center> info goes here </center>

Most people put them in tables first and just center the table.

Otherwise you can do as teedoff suggested and add to the css properties to center the whole layout

Here's a vid on how
http://www.youtube.com/watch?v=aVXwX80PBQQ

meisjen
Newbie Poster
7 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

also, here is a youtube video of how to center images in photoshop, the video is for cs3, but should work for cs4 as well.

http://www.youtube.com/watch?v=-aR7nvH2SFI

meisjen
Newbie Poster
7 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

When you say center, do you mean making the webpage even? The best thing in photoshop is to turn on the grids and use the guides.

For grids, go to View -->Show-->Grid This will automatically show your webpage in even blocks, sometimes they are uneven you might have to adjust the canvas size or trim.

The guides are essential if you want to place layers on your webpage and have them even with the rest of the design (or if you want to center images). Just go to View-->New Guide choose vertical or horizontal (just drag the guides where you want according to the grid). The guides snap to the grids automatically so you shouldnt have a problem properly centering with this method.

meisjen
Newbie Poster
7 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Hey guys complete noob/novice here,

Looking to join multiple tables identical in structure. It's meant for a search box in my school project.

If I have table 1 and table 2 identical in structure, when the user searches for "keyword" it will search through both table 1 and table 2 and return the results from both. As it stands I only have it returning results from table 1.

I did google this first, found this thread.
http://www.daniweb.com/web-development/databases/mysql/threads/378594
Seems like brillig might have the right solution, but honestly, I'm trying to follow how he came up with that, I've tried multiple ways and I'm getting errors/no results.

Here is a snippet of my code if it helps. Articles2 is my table, I'd like to search both articles2 and articles3.

$results = "SELECT `title`, LEFT(`description`, 70) as `description`, `url` FROM `articles2` WHERE $where";
$results_num = ($results = mysql_query($results)) ? mysql_num_rows($results) : 0;

Also, if I could make one big table that would be great, but it seems the current table won't go past 4,993 records, if there was a way to increase this I wouldn't bother with this.

If you need more info please let me know, I think I need UNION but I'm not exactly sure how to write it, the examples and answers I've seen across the web haven't been new user friendly, so any help would be appreciated.

meisjen
Newbie Poster
7 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
 
© 2013 DaniWeb® LLC
Page rendered in 0.0586 seconds using 2.5MB