Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. <?php $number = 1; echo '<a href="redirect.php?num=' . ($number+1).'">Add Event</a>'; ?> Close...
  2. Beatin to it, but hey I did alot of hard work...actually I just pulled this from preg_match and modified a bit <?php $string = "hello my email email@site.com"; $pattern = '/([a-z0-9])(([-a-z0-9._])*([a-z0-9]))*\@([a-z0-9])' . '(([a-z0-9-])*([a-z0-9]))+' . '(\.([a-z0-9])([-a-z0-9_-])?([a-z0-9])+)/i'; preg_match ($pattern, $string, $matches); echo "We extracted " . $matches[0] . " from $string"; ?> Should do it.
  3. Thank U premiso...it works now..I appreciate If you want to know why, accessing that there set the pointer to be +1 so when you looped through it, it was under the impression you already accessed the first element. Anyhow I was just bored so figured I would explain it.
  4. $row_users = mysql_fetch_assoc($users); That is the line that is messing you up. Remove that and your script should work fine.
  5. Sweeeeeet....maybe every other day I will be the other =P
  6. I am not 100% familiar with the simple xml, and more code might help but I think this would work: <?php $string = <<<XML <a xmlns:b> <foo name="one" game="lonely">1</foo> </a> XML; $xml = simplexml_load_string($string); foreach($xml->foo[0]->attributes() as $a => $b) { echo $a,'="',$b,"\"\n"; } ?> The above is an example taken from SimpleXML->atrribute Hopefully that helps ya.
  7. Well have a great one! Hope to see you around in the future!
  8. Just say my new title Thanks for that!
  9. <?php function get_data($url) { $ch = curl_init(); $timeout = 5; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); $data = curl_exec($ch); curl_close($ch); return $data; } $main_url = "http://www.phpfreaks.com/"; $url = $main_url; if (isset($_GET['url'])) { if (stristr($main_url, $_GET['url']) !== false) { $url = $_GET['url']; } } $returned_content = get_data($url); echo str_replace('a href="/', 'a href="http://www.yoursite.com/script.php?url=' . $main_url, $returned_content); ?> I tested that on my server and it worked great. Given that the links are relative and not absolute.
  10. <?php function get_data($url) { $ch = curl_init(); $timeout = 5; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); $data = curl_exec($ch); curl_close($ch); return $data; } $url = "http://www.externalsitehere.com"; if (isset($_GET['url'])) { if (stristr($url, $_GET['url']) !== false) { $url = $_GET['url']; } } $returned_content = get_data($url); echo str_replace("</head>", '<base href="http://www.yoursite.com/script.php?url=http://www.externalsitehere.com"></head>', $returned_content); ?> Give that a try, and make sure to replace the external site and the yoursite portions.
  11. Well you will need a script and re-code all the links to goto your site and re-parse it each time. Basically you would call the current script and have the "get_data($_GET['url'])" then you will have to do that str_relpace and instead of adding just the external site, you would do something like: echo str_replace("</head>", '<base href="http://www.yoursite.com/script.php?url=http://www.externalsitehere.com"></head>', $returned_content); Then make sure you check the $_GET data before parsing it cause it could allow someone to manually change that.
  12. You have to use CSS to prevent them from breaking. Not sure of the code but that is where you want to look. Display:inline; may be the attribute, but not sure.
  13. array_rand
  14. You can always use the base tag in html, doubt that this is valid html, but it should work, this allows assumes there is a </head> tag on the external site: <?php function get_data($url) { $ch = curl_init(); $timeout = 5; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); $data = curl_exec($ch); curl_close($ch); return $data; } $returned_content = get_data('http://www.externalsitehere.com'); echo str_replace("</head>", '<base href="http://www.externalsitehere.com"></head>', $returned_content); ?> Should take care of the urls, however the stylesheet may catch on to this also, so yea.
  15. Tools > Error Console
  16. Why are you passing a table_id via get? Should that be post?
  17. I would use quotes in your html around the attributes. <td>Datum behaald</td><td><input type='text' class='input2' name='dat' value='$datbeh'> (JJJJ-MM-DD)</td> Try that out and see if that maybe works. I am still unsure on why it would be subtracting each other, if that does not work try to change this part also: $datbeh = (string)$_GET['d']; And see if that works or not. Also you should really use single quotes around your mysql data. mysql_query("UPDATE SOK SET Kwartaalnr='$kwart', Goedgekeurd='$goedgk', Score='$score', DatumBehaald='$datbeh', EC='$ec' WHERE SOKnr='$sok'") or die (mysql_error()); Give those a try and see if that fixes the issue.
  18. Not to mention he is also not looping through the data, look at mysql_fetch_array for examples of how to loop through mysql data.
  19. premiso

    LIMIT

    Silly question, but is the file being updated properly and or uploaded after (if needed). I ran a similar query on my server and it limited it to 5 just fine for me.
  20. if ( isset ( $_SESSION['items'] ) && is_array($_SESSION['items'])) Obviously the $_SESSION['items'] is not an array. So something is messing up somewhere when you are trying to define it as an array. Maybe you are using the old session. close your browser and open a new one and try again.
  21. Ummmm post the error next time and more code and please use the [.code] [./code] tags (without the dot) when posting code. Either $darr or $narr does not have an index at $i.
  22. The directory where you are to copy the image to make sure it has read/write permissions. It sounds like that doesn't. Also, $HTTP_POST_VARS...etc is depreciated, use $_POST or in this case $_FILES instead. If you want someone to help you dig a hole, you do not give them a spoon.
  23. it continues to subtract Then there is something up with your form or your server. Anything coming in from an html form or get/post data should be stored as a string and not acted on literally. Post the form code for us and more of the page where that is happening; Something else is going on.
  24. <?php $file = isset($_GET['a'])?basename($_GET['a']):index; $allowed = array("index", "home", "contact"); if (!file_exists($file)) $file = "index"; elseif (!in_array($file, $allowed)) $file = "index"; // this line is here so we show something, it defaults to index if there is a problem. You also did not use the "echo" command for the "Sorry... so it was an invalid deal. include($file . ".php"); ?> See comments above.
  25. premiso

    LIMIT

    Where is $logged being populated from? I fail to see that part...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.